diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-07-26 15:14:21 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-08-06 22:54:18 +0200 |
commit | 3e99834cc0c7f0612dc790ad7342f18c375d285b (patch) | |
tree | d08c5bca639ee6f04f2fbf39cc01cf8daa76025f /drivers/i2c | |
parent | i2c: designware: Fix unused variable warning (diff) | |
download | linux-3e99834cc0c7f0612dc790ad7342f18c375d285b.tar.xz linux-3e99834cc0c7f0612dc790ad7342f18c375d285b.zip |
i2c: Drop unneeded check for of_node
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index f26ed495d384..b4d84bd475da 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -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); |