OSDN Git Service

iio: adc: cc10001: Use devm_ to call device power down.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 16 Oct 2022 17:09:49 +0000 (18:09 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 23 Nov 2022 19:44:04 +0000 (19:44 +0000)
commita43d5155b9455d38c4b3e4656131d79af61a2978
tree22895e9366a771b611fe019fb2a05c88f74a8449
parentc247e0d8c0d50793f459d2a7997d2f8f2105c973
iio: adc: cc10001: Use devm_ to call device power down.

It is presumably safe to call the powerdown whether or not we are
in the commented shared state (the driver always did this).

The power down was previously out of order wrt to the probe() function
so move using devm_ will ensure it occurs after the userspace interfaces
are removed.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016170950.387751-5-jic23@kernel.org
drivers/iio/adc/cc10001_adc.c