iio: temperature: tmp006: convert probe to device-managed
authorAlexandru Ardelean <aardelean@deviqon.com>
Thu, 24 Jun 2021 08:19:23 +0000 (11:19 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 19 Jul 2021 08:51:59 +0000 (09:51 +0100)
commit2bb3b8f69accde535daee238e0f707dec452e0e4
treeef87f355bdb2ae8f88624efb0326e29ba93ebf14
parent3ce868bb0595be1e4d75b0e1a055f2dc0867d335
iio: temperature: tmp006: convert probe to device-managed

This change converts the driver to register via devm_iio_device_register().
For the tmp006_powerdown() hook, this uses a devm_add_action() hook to put
the device in powerdown mode when it's unregistered.

With these changes, the remove hook can be removed.

The i2c_set_clientdata() call is staying around as the private data is used
in the PM routines.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210624081924.15897-1-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/tmp006.c