iio: light: tsl2583: Fix module unloading
authorShreeya Patel <shreeya.patel@collabora.com>
Fri, 26 Aug 2022 12:23:52 +0000 (17:53 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Oct 2022 07:51:26 +0000 (08:51 +0100)
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>
drivers/iio/light/tsl2583.c

index 0a2ca1a8146da4690e570c693ec8a68530d855ba..7bcb5c7189224b9b35c2061f09806a8458a2e745 100644 (file)
@@ -858,7 +858,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__);