]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ti-adc161s626: Use devm managed functions for all of probe.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 16 May 2021 17:25:20 +0000 (18:25 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 22 May 2021 18:30:25 +0000 (19:30 +0100)
commit301f7eba67df8868cb22b0ba2af0fc0cdfe70d8a
treeb06746b28c43e7aaf381770506431bdb3d29c6d9
parent63a19756cde1bdec91c10c6f88c94dda5872daa1
iio: adc: ti-adc161s626: Use devm managed functions for all of probe.

Simplifies error handling and allows us to drop remove entirely.

The regulator handling in this driver was unusual as it would try to
acquire the regulator, but if that failed with an error would continue.

We should get a stub regulator if one isn't provided in DT and an error
could indicate an actual problem preventing the device being powered
(perhaps a need to defer). So this handling is cleaned up (arguably
that might be a fix but given no one has run into it, I haven't broken
it out separately.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210516172520.1398835-9-jic23@kernel.org
drivers/iio/adc/ti-adc161s626.c