i2c: Drop unneeded check for of_node
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 26 Jul 2019 13:14:21 +0000 (16:14 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 6 Aug 2019 20:54:18 +0000 (22:54 +0200)
of_find_property() will return NULL if of_node is NULL,
thus of_irq_get_by_name() returns -EINVAL which we ignore,
so no need to double check.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-core-base.c

index f26ed495d38420b3864c997945940941dcf5e754..b4d84bd475da2f100e3a11eb505a2f552f5c5882 100644 (file)
@@ -350,13 +350,11 @@ static int i2c_device_probe(struct device *dev)
                return -ENODEV;
 
        if (client->flags & I2C_CLIENT_WAKE) {
-               int wakeirq = -ENOENT;
+               int wakeirq;
 
-               if (dev->of_node) {
-                       wakeirq = of_irq_get_byname(dev->of_node, "wakeup");
-                       if (wakeirq == -EPROBE_DEFER)
-                               return wakeirq;
-               }
+               wakeirq = of_irq_get_byname(dev->of_node, "wakeup");
+               if (wakeirq == -EPROBE_DEFER)
+                       return wakeirq;
 
                device_init_wakeup(&client->dev, true);