i2c: fix wakeup irq parsing
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 12 Nov 2015 13:42:26 +0000 (15:42 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 20 Nov 2015 15:19:08 +0000 (16:19 +0100)
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.

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>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: <stable@vger.kernel.org> # v4.3
drivers/i2c/i2c-core.c

index 040af5cc8143f1aff2ce8ebaf0143482ddfeee02..ba8eb087f224655d1853c1192371759cf4d5e9f0 100644 (file)
@@ -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;