[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190726123058.22915-1-hslester96@gmail.com>
Date: Fri, 26 Jul 2019 20:30:58 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org, Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] iio: tsl2772: Use device-managed API
Use devm_iio_device_register to simplify
the code.
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
drivers/iio/light/tsl2772.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c
index 83cece921843..aa5891d105e8 100644
--- a/drivers/iio/light/tsl2772.c
+++ b/drivers/iio/light/tsl2772.c
@@ -1877,7 +1877,7 @@ static int tsl2772_probe(struct i2c_client *clientp,
if (ret < 0)
return ret;
- ret = iio_device_register(indio_dev);
+ ret = devm_iio_device_register(&clientp->dev, indio_dev);
if (ret) {
tsl2772_chip_off(indio_dev);
dev_err(&clientp->dev,
@@ -1928,8 +1928,6 @@ static int tsl2772_remove(struct i2c_client *client)
tsl2772_chip_off(indio_dev);
- iio_device_unregister(indio_dev);
-
return 0;
}
--
2.20.1
Powered by blists - more mailing lists