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


Groups > linux.kernel > #1267937 > unrolled thread

[PATCH] i2c: core: fix wakeup irq parsing

Started byGrygorii Strashko <grygorii.strashko@ti.com>
First post2015-11-12 14:50 +0100
Last post2015-11-12 19:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] i2c: core: fix wakeup irq parsing Grygorii Strashko <grygorii.strashko@ti.com> - 2015-11-12 14:50 +0100
    Re: [PATCH] i2c: core: fix wakeup irq parsing Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-11-12 19:20 +0100

#1267937 — [PATCH] i2c: core: fix wakeup irq parsing

FromGrygorii Strashko <grygorii.strashko@ti.com>
Date2015-11-12 14:50 +0100
Subject[PATCH] i2c: core: fix wakeup irq parsing
Message-ID<qu0qe-16P-27@gated-at.bofh.it>
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

--
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]


#1268169

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2015-11-12 19:20 +0100
Message-ID<qu4Dw-3VM-15@gated-at.bofh.it>
In reply to#1267937
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
--
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] | [standalone]


Back to top | Article view | linux.kernel


csiph-web