All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: core: fix wakeup irq parsing
@ 2015-11-12 13:42 ` Grygorii Strashko
  0 siblings, 0 replies; 4+ messages in thread
From: Grygorii Strashko @ 2015-11-12 13:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Sekhar Nori, linux-i2c, linux-kernel, Grygorii Strashko,
	Dmitry Torokhov, Felipe Balbi, # v4 . 3

This patch fixes obvious copy-past error in wake up irq parsing
code which leads to the fact that dev_pm_set_wake_irq() will
be called with wrong IRQ number when "wakeup" IRQ is not
defined in DT.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: <stable@vger.kernel.org> # v4.3
Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 040af5c..ba8eb08 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -715,7 +715,7 @@ static int i2c_device_probe(struct device *dev)
 		if (wakeirq > 0 && wakeirq != client->irq)
 			status = dev_pm_set_dedicated_wake_irq(dev, wakeirq);
 		else if (client->irq > 0)
-			status = dev_pm_set_wake_irq(dev, wakeirq);
+			status = dev_pm_set_wake_irq(dev, client->irq);
 		else
 			status = 0;
 
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] i2c: core: fix wakeup irq parsing
@ 2015-11-12 13:42 ` Grygorii Strashko
  0 siblings, 0 replies; 4+ messages in thread
From: Grygorii Strashko @ 2015-11-12 13:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Sekhar Nori, linux-i2c, linux-kernel, Grygorii Strashko,
	Dmitry Torokhov, Felipe Balbi, # v4 . 3

This patch fixes obvious copy-past error in wake up irq parsing
code which leads to the fact that dev_pm_set_wake_irq() will
be called with wrong IRQ number when "wakeup" IRQ is not
defined in DT.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: <stable@vger.kernel.org> # v4.3
Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/i2c/i2c-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 040af5c..ba8eb08 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -715,7 +715,7 @@ static int i2c_device_probe(struct device *dev)
 		if (wakeirq > 0 && wakeirq != client->irq)
 			status = dev_pm_set_dedicated_wake_irq(dev, wakeirq);
 		else if (client->irq > 0)
-			status = dev_pm_set_wake_irq(dev, wakeirq);
+			status = dev_pm_set_wake_irq(dev, client->irq);
 		else
 			status = 0;
 
-- 
2.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: core: fix wakeup irq parsing
  2015-11-12 13:42 ` Grygorii Strashko
  (?)
@ 2015-11-12 18:16 ` Dmitry Torokhov
  -1 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2015-11-12 18:16 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Wolfram Sang, Sekhar Nori, linux-i2c, linux-kernel, Felipe Balbi,
	# v4 . 3

On Thu, Nov 12, 2015 at 03:42:26PM +0200, Grygorii Strashko wrote:
> This patch fixes obvious copy-past error in wake up irq parsing
> code which leads to the fact that dev_pm_set_wake_irq() will
> be called with wrong IRQ number when "wakeup" IRQ is not
> defined in DT.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: <stable@vger.kernel.org> # v4.3
> Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

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

I wonder if we should change dev_pm_set_wake_irq and
dev_pm_set_dedicated_wake_irq to check if passed in IRQ is valid.

> ---
>  drivers/i2c/i2c-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 040af5c..ba8eb08 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -715,7 +715,7 @@ static int i2c_device_probe(struct device *dev)
>  		if (wakeirq > 0 && wakeirq != client->irq)
>  			status = dev_pm_set_dedicated_wake_irq(dev, wakeirq);
>  		else if (client->irq > 0)
> -			status = dev_pm_set_wake_irq(dev, wakeirq);
> +			status = dev_pm_set_wake_irq(dev, client->irq);
>  		else
>  			status = 0;
>  
> -- 
> 2.6.3
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: core: fix wakeup irq parsing
  2015-11-12 13:42 ` Grygorii Strashko
  (?)
  (?)
@ 2015-11-20 15:19 ` Wolfram Sang
  -1 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-11-20 15:19 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Sekhar Nori, linux-i2c, linux-kernel, Dmitry Torokhov,
	Felipe Balbi, # v4 . 3

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

On Thu, Nov 12, 2015 at 03:42:26PM +0200, Grygorii Strashko wrote:
> This patch fixes obvious copy-past error in wake up irq parsing
> code which leads to the fact that dev_pm_set_wake_irq() will
> be called with wrong IRQ number when "wakeup" IRQ is not
> defined in DT.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: <stable@vger.kernel.org> # v4.3
> Fixes: 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree")
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Applied to for-current, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-20 15:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-12 13:42 [PATCH] i2c: core: fix wakeup irq parsing Grygorii Strashko
2015-11-12 13:42 ` Grygorii Strashko
2015-11-12 18:16 ` Dmitry Torokhov
2015-11-20 15:19 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.