iio: light: tcs3414: convert probe to device-managed routines
authorAlexandru Ardelean <aardelean@deviqon.com>
Thu, 24 Jun 2021 08:05:34 +0000 (11:05 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 19 Jul 2021 08:51:59 +0000 (09:51 +0100)
commit9ae8da91a22cdd916f20cc4ba59911d084c7e26e
tree8bac62fcf5e74e35463ef584f76a88d7a86a1c64
parentd272e0ab5f4bcaf0a29e7606854cfb5a9b725758
iio: light: tcs3414: convert probe to device-managed routines

This change converts the driver to use only device-managed init routines in
the probe function of the driver.

This way, we no longer need the tcs3414_remove() hook.
We still need to keep the i2c_set_clientdata() call, as that's being used
for the PM routines.

And lastly, a devm_add_action_or_reset() hook is added to call the
powerdown handler when the chip is uninitialized or the probe fails.

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