diff options
author | Shreeya Patel <shreeya.patel@collabora.com> | 2022-08-26 15:23:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-03 17:57:49 +0300 |
commit | af236da8552ecbe0ecb779411611826e87d7a831 (patch) | |
tree | 2d6d94769b27bf66d132ec28eddb13f94b82f321 /drivers | |
parent | 90ff5bef2bc7e55862df3c623175a9ee125e7715 (diff) | |
download | linux-af236da8552ecbe0ecb779411611826e87d7a831.tar.xz |
iio: light: tsl2583: Fix module unloading
commit 0dec4d2f2636b9e54d9d29f17afc7687c5407f78 upstream.
tsl2583 probe() uses devm_iio_device_register() and calling
iio_device_unregister() causes the unregister to occur twice. s
Switch to iio_device_register() instead of devm_iio_device_register()
in probe to avoid the device managed cleanup.
Fixes: 371894f5d1a0 ("iio: tsl2583: add runtime power management support")
Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com>
Link: https://lore.kernel.org/r/20220826122352.288438-1-shreeya.patel@collabora.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/light/tsl2583.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c index 40b7dd266b31..e39d512145a6 100644 --- a/drivers/iio/light/tsl2583.c +++ b/drivers/iio/light/tsl2583.c @@ -856,7 +856,7 @@ static int tsl2583_probe(struct i2c_client *clientp, TSL2583_POWER_OFF_DELAY_MS); pm_runtime_use_autosuspend(&clientp->dev); - ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev); + ret = iio_device_register(indio_dev); if (ret) { dev_err(&clientp->dev, "%s: iio registration failed\n", __func__); |