diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2019-06-27 05:24:11 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-06-29 07:18:01 -0400 |
commit | 6e76cb7dfd34a2e3a13a0290eca19c0060764964 (patch) | |
tree | ed3f214bdb2938147a740929b8c4f1cbae1f917e | |
parent | 8466b616cbee91641a419c98d77027cef84066e5 (diff) |
i2c: core: Tidy up handling of init_irq
Only set init_irq during i2c_device_new and only handle client->irq on
the probe/remove paths.
Suggested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index b70c2a9a342f..d9b6341f9fd1 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c | |||
@@ -322,6 +322,8 @@ static int i2c_device_probe(struct device *dev) | |||
322 | 322 | ||
323 | driver = to_i2c_driver(dev->driver); | 323 | driver = to_i2c_driver(dev->driver); |
324 | 324 | ||
325 | client->irq = client->init_irq; | ||
326 | |||
325 | if (!client->irq && !driver->disable_i2c_core_irq_mapping) { | 327 | if (!client->irq && !driver->disable_i2c_core_irq_mapping) { |
326 | int irq = -ENOENT; | 328 | int irq = -ENOENT; |
327 | 329 | ||
@@ -432,7 +434,7 @@ static int i2c_device_remove(struct device *dev) | |||
432 | dev_pm_clear_wake_irq(&client->dev); | 434 | dev_pm_clear_wake_irq(&client->dev); |
433 | device_init_wakeup(&client->dev, false); | 435 | device_init_wakeup(&client->dev, false); |
434 | 436 | ||
435 | client->irq = client->init_irq; | 437 | client->irq = 0; |
436 | if (client->flags & I2C_CLIENT_HOST_NOTIFY) | 438 | if (client->flags & I2C_CLIENT_HOST_NOTIFY) |
437 | pm_runtime_put(&client->adapter->dev); | 439 | pm_runtime_put(&client->adapter->dev); |
438 | 440 | ||
@@ -749,7 +751,6 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf | |||
749 | if (!client->init_irq) | 751 | if (!client->init_irq) |
750 | client->init_irq = i2c_dev_irq_from_resources(info->resources, | 752 | client->init_irq = i2c_dev_irq_from_resources(info->resources, |
751 | info->num_resources); | 753 | info->num_resources); |
752 | client->irq = client->init_irq; | ||
753 | 754 | ||
754 | strlcpy(client->name, info->type, sizeof(client->name)); | 755 | strlcpy(client->name, info->type, sizeof(client->name)); |
755 | 756 | ||