[PATCH 3/3] iio: light: vcnl4000: register an IIO device with a device-managed function

Erikas Bitovtas posted 3 patches 9 hours ago
[PATCH 3/3] iio: light: vcnl4000: register an IIO device with a device-managed function
Posted by Erikas Bitovtas 9 hours ago
Use a device-managed counterpart of iio_device_register() and remove the
redundant iio_device_unregister() call in driver remove function.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
 drivers/iio/light/vcnl4000.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index cbe0a9e056ec..4ba91dac1f55 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -2043,7 +2043,7 @@ static int vcnl4000_probe(struct i2c_client *client)
 	if (ret < 0)
 		goto fail_poweroff;
 
-	ret = iio_device_register(indio_dev);
+	ret = devm_iio_device_register(dev, indio_dev);
 	if (ret < 0)
 		goto fail_poweroff;
 
@@ -2099,7 +2099,6 @@ static void vcnl4000_remove(struct i2c_client *client)
 
 	pm_runtime_dont_use_autosuspend(&client->dev);
 	pm_runtime_disable(&client->dev);
-	iio_device_unregister(indio_dev);
 	pm_runtime_set_suspended(&client->dev);
 
 	ret = data->chip_spec->set_power_state(data, false);

-- 
2.52.0