[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240929-veml6070-cleanup-v1-3-a9350341a646@gmail.com>
Date: Sun, 29 Sep 2024 22:38:48 +0200
From: Javier Carrasco <javier.carrasco.cruz@...il.com>
To: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org,
Javier Carrasco <javier.carrasco.cruz@...il.com>
Subject: [PATCH 3/7] iio: light: veml6070: use device managed
iio_device_register
Simplify the code by using devm_iio_device_register(), which removes the
need for a 'remove' function, as there are no more actions to take.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
---
drivers/iio/light/veml6070.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
index 945ef58beead..d15caebdc959 100644
--- a/drivers/iio/light/veml6070.c
+++ b/drivers/iio/light/veml6070.c
@@ -179,15 +179,7 @@ static int veml6070_probe(struct i2c_client *client)
if (ret < 0)
return ret;
- return iio_device_register(indio_dev);
-}
-
-static void veml6070_remove(struct i2c_client *client)
-{
- struct iio_dev *indio_dev = i2c_get_clientdata(client);
- struct veml6070_data *data = iio_priv(indio_dev);
-
- iio_device_unregister(indio_dev);
+ return devm_iio_device_register(&client->dev, indio_dev);
}
static const struct i2c_device_id veml6070_id[] = {
@@ -201,7 +193,6 @@ static struct i2c_driver veml6070_driver = {
.name = VEML6070_DRV_NAME,
},
.probe = veml6070_probe,
- .remove = veml6070_remove,
.id_table = veml6070_id,
};
--
2.43.0
Powered by blists - more mailing lists