Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1245126 > unrolled thread

[PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach

Started byKieran Bingham <kieranbingham@gmail.com>
First post2015-10-12 23:00 +0200
Last post2015-10-15 13:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach Kieran Bingham <kieranbingham@gmail.com> - 2015-10-12 23:00 +0200
    Re: [PATCH v3] i2c: return probe deferred status on  dev_pm_domain_attach Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-10-12 23:10 +0200
    Re: [PATCH v3] i2c: return probe deferred status on  dev_pm_domain_attach Wolfram Sang <wsa@the-dreams.de> - 2015-10-15 13:40 +0200

#1245126 — [PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach

FromKieran Bingham <kieranbingham@gmail.com>
Date2015-10-12 23:00 +0200
Subject[PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach
Message-ID<qiSml-1Ya-11@gated-at.bofh.it>
A change of return status was introduced in commit 3fffd1283927
("i2c: allow specifying separate wakeup interrupt in device tree")

The commit prevents the defer status being passed up the call stack
appropriately when dev_pm_domain_attach returns -EPROBE_DEFER.

Catch the PROBE_DEFER and clear up the IRQ wakeup status

Signed-off-by: Kieran Bingham <kieranbingham@gmail.com>
Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup
interrupt in device tree")

---
V2:
 Fall through the error path before returning -EPROBE_DEFER

V3:
 Drop the if/else for cleaner code path

 drivers/i2c/i2c-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 5f89f1e3c2f2..a59c3111f7fb 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -694,12 +694,12 @@ static int i2c_device_probe(struct device *dev)
 		goto err_clear_wakeup_irq;
 
 	status = dev_pm_domain_attach(&client->dev, true);
-	if (status != -EPROBE_DEFER) {
-		status = driver->probe(client, i2c_match_id(driver->id_table,
-					client));
-		if (status)
-			goto err_detach_pm_domain;
-	}
+	if (status == -EPROBE_DEFER)
+		goto err_clear_wakeup_irq;
+
+	status = driver->probe(client, i2c_match_id(driver->id_table, client));
+	if (status)
+		goto err_detach_pm_domain;
 
 	return 0;
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1245138 — Re: [PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2015-10-12 23:10 +0200
SubjectRe: [PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach
Message-ID<qiSw2-2oF-17@gated-at.bofh.it>
In reply to#1245126
On Mon, Oct 12, 2015 at 09:54:43PM +0100, Kieran Bingham wrote:
> A change of return status was introduced in commit 3fffd1283927
> ("i2c: allow specifying separate wakeup interrupt in device tree")
> 
> The commit prevents the defer status being passed up the call stack
> appropriately when dev_pm_domain_attach returns -EPROBE_DEFER.
> 
> Catch the PROBE_DEFER and clear up the IRQ wakeup status
> 
> Signed-off-by: Kieran Bingham <kieranbingham@gmail.com>
> Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup
> interrupt in device tree")

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> 
> ---
> V2:
>  Fall through the error path before returning -EPROBE_DEFER
> 
> V3:
>  Drop the if/else for cleaner code path
> 
>  drivers/i2c/i2c-core.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 5f89f1e3c2f2..a59c3111f7fb 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -694,12 +694,12 @@ static int i2c_device_probe(struct device *dev)
>  		goto err_clear_wakeup_irq;
>  
>  	status = dev_pm_domain_attach(&client->dev, true);
> -	if (status != -EPROBE_DEFER) {
> -		status = driver->probe(client, i2c_match_id(driver->id_table,
> -					client));
> -		if (status)
> -			goto err_detach_pm_domain;
> -	}
> +	if (status == -EPROBE_DEFER)
> +		goto err_clear_wakeup_irq;
> +
> +	status = driver->probe(client, i2c_match_id(driver->id_table, client));
> +	if (status)
> +		goto err_detach_pm_domain;
>  
>  	return 0;
>  
> -- 
> 2.1.4
> 

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1247706 — Re: [PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach

FromWolfram Sang <wsa@the-dreams.de>
Date2015-10-15 13:40 +0200
SubjectRe: [PATCH v3] i2c: return probe deferred status on dev_pm_domain_attach
Message-ID<qjP34-592-21@gated-at.bofh.it>
In reply to#1245126

[Multipart message — attachments visible in raw view] — view raw

On Mon, Oct 12, 2015 at 09:54:43PM +0100, Kieran Bingham wrote:
> A change of return status was introduced in commit 3fffd1283927
> ("i2c: allow specifying separate wakeup interrupt in device tree")
> 
> The commit prevents the defer status being passed up the call stack
> appropriately when dev_pm_domain_attach returns -EPROBE_DEFER.
> 
> Catch the PROBE_DEFER and clear up the IRQ wakeup status
> 
> Signed-off-by: Kieran Bingham <kieranbingham@gmail.com>
> Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup
> interrupt in device tree")
> 

Applied to for-current, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web