diff options
author | Alexandru Ardelean <aardelean@deviqon.com> | 2021-06-24 10:04:40 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-07-19 10:51:59 +0200 |
commit | d372e5a19a8eb281428954b5edbd033d824f1bf0 (patch) | |
tree | f1d0de0e8dd5d283db5e93f627fde0481d47902a /drivers/iio/accel/adxl345_i2c.c | |
parent | iio: light: tcs3414: convert probe to device-managed routines (diff) | |
download | linux-d372e5a19a8eb281428954b5edbd033d824f1bf0.tar.xz linux-d372e5a19a8eb281428954b5edbd033d824f1bf0.zip |
iio: accel: adxl345: convert probe to device-managed functions
This driver has two parts, one for i2c and one for spi, since the chip can
operate with both wire protocols.
The core file has a common adxl345_core_remove() function which puts the
chip into a powerdown state. This can be implemented with a
devm_add_action_or_reset() hook.
Doing that means we can register the IIO device with
devm_iio_device_register() and get rid of the adxl345_core_remove()
function.
The dev_set_drvdata() call can be removed as there is no other user of this
private data anymore.
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210624080441.8710-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/adxl345_i2c.c')
-rw-r--r-- | drivers/iio/accel/adxl345_i2c.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c index 1561364ae296..a431cba216e6 100644 --- a/drivers/iio/accel/adxl345_i2c.c +++ b/drivers/iio/accel/adxl345_i2c.c @@ -38,11 +38,6 @@ static int adxl345_i2c_probe(struct i2c_client *client, id->name); } -static int adxl345_i2c_remove(struct i2c_client *client) -{ - return adxl345_core_remove(&client->dev); -} - static const struct i2c_device_id adxl345_i2c_id[] = { { "adxl345", ADXL345 }, { "adxl375", ADXL375 }, @@ -65,7 +60,6 @@ static struct i2c_driver adxl345_i2c_driver = { .of_match_table = adxl345_of_match, }, .probe = adxl345_i2c_probe, - .remove = adxl345_i2c_remove, .id_table = adxl345_i2c_id, }; |