Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07ef3be6 authored by Shreeya Patel's avatar Shreeya Patel Committed by Greg Kroah-Hartman
Browse files

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: 371894f5 ("iio: tsl2583: add runtime power management support")
Signed-off-by: default avatarShreeya 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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cb972e6d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -857,7 +857,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__);