iio: accel: adxl345: convert probe to device-managed functions
authorAlexandru Ardelean <aardelean@deviqon.com>
Thu, 24 Jun 2021 08:04:40 +0000 (11:04 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 19 Jul 2021 08:51:59 +0000 (09:51 +0100)
commitd372e5a19a8eb281428954b5edbd033d824f1bf0
treef1d0de0e8dd5d283db5e93f627fde0481d47902a
parent9ae8da91a22cdd916f20cc4ba59911d084c7e26e
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>
drivers/iio/accel/adxl345.h
drivers/iio/accel/adxl345_core.c
drivers/iio/accel/adxl345_i2c.c
drivers/iio/accel/adxl345_spi.c