iio: proximity: rfd77402: convert probe to device-managed functions
authorAlexandru Ardelean <aardelean@deviqon.com>
Wed, 30 Jun 2021 13:16:36 +0000 (16:16 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 17 Jul 2021 17:49:30 +0000 (18:49 +0100)
commit148da125a0c825aa1576602391d6eece6568226f
treeebed4d68969fe06181d2eb64456fb9cd010f61df
parent09d5135b6ffcb243580a4a77f299a0253a94f5e3
iio: proximity: rfd77402: convert probe to device-managed functions

This change converts the probe hook to register the IIO device with
devm_iio_device_register() and register a hook with
devm_add_action_or_reset() to put the device in powerdown when the driver
gets unloaded.

Since the PM suspend/resume functions need only a reference to the
i2c_client object (which can be obtained from the base device object), the
i2c_set_clientdata() call can be removed.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210630131636.1563148-2-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/rfd77402.c