summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2018-10-19 09:59:58 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 07:21:42 +0200
commit1e031ab31843d7b6e0ddc027ffde596f0b833b88 (patch)
tree52115cc2a421143dbc4060dbdae43e1bc58e637b /drivers/i2c
parent63eab25ed1cc75540d1d70bdc86d252b1d3608b5 (diff)
downloadlinux-stable-1e031ab31843d7b6e0ddc027ffde596f0b833b88.tar.gz
linux-stable-1e031ab31843d7b6e0ddc027ffde596f0b833b88.tar.bz2
linux-stable-1e031ab31843d7b6e0ddc027ffde596f0b833b88.zip
i2c: Clear client->irq in i2c_device_remove
commit 6f108dd70d3010c391c1e9f56f3f20d1f9e75450 upstream. The IRQ will be mapped in i2c_device_probe only if client->irq is zero and i2c_device_remove does not clear this. When rebinding an I2C device, whos IRQ provider has also been rebound this means that an IRQ mapping will never be created, causing the I2C device to fail to acquire its IRQ. Fix this issue by clearing client->irq in i2c_device_remove, forcing i2c_device_probe to lookup the mapping again. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core-base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 370374086a6e..9a481732687b 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -430,6 +430,8 @@ static int i2c_device_remove(struct device *dev)
dev_pm_clear_wake_irq(&client->dev);
device_init_wakeup(&client->dev, false);
+ client->irq = 0;
+
return status;
}