mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] iio: light: tsl2583: Fix module unloading
@ 2022-08-26 12:23 Shreeya Patel
  2022-08-28 16:33 ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Shreeya Patel @ 2022-08-26 12:23 UTC (permalink / raw)
  To: jic23, lars
  Cc: krisman, dmitry.osipenko, kernel, linux-iio, linux-kernel,
	Shreeya Patel, stable

tsl2583 uses devm_iio_device_register() function and
calling iio_device_unregister() in remove breaks the
module unloading.
Fix this by using iio_device_register() instead of
devm_iio_device_register() function in probe.

Cc: stable@vger.kernel.org
Fixes: 371894f5d1a0 ("iio: tsl2583: add runtime power management support")
Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com>
---
Changes in v2
  - Use iio_device_register() instead of devm_iio_device_register()
  - Add fixes and stable tags

 drivers/iio/light/tsl2583.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
index 82662dab87c0..94d75ec687c3 100644
--- a/drivers/iio/light/tsl2583.c
+++ b/drivers/iio/light/tsl2583.c
@@ -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__);
-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-11 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 12:23 [PATCH v2] iio: light: tsl2583: Fix module unloading Shreeya Patel
2022-08-28 16:33 ` Jonathan Cameron
2022-08-31 13:50   ` Shreeya Patel
2022-09-08 18:55   ` Shreeya Patel
2022-09-11  9:58     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®