iio: adc: rockchip_saradc: move all of probe to devm-functions
authorHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
Tue, 23 Jun 2020 23:30:09 +0000 (01:30 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 27 Jun 2020 12:00:26 +0000 (13:00 +0100)
commitd0389d4ed3c5a298939646b5d59bd5ad4ce5491f
tree2d5fa25d24a9a33ea6633ebc3f43ad9f81a00838
parentf11d59d87b8622d4cf9f856c0b8029fb030d8612
iio: adc: rockchip_saradc: move all of probe to devm-functions

Parts of the saradc probe rely on devm functions and later parts do not.
This makes it more difficult to for example enable triggers via their
devm-functions and would need more undo-work in remove.

So to make life easier for the driver, move the rest of probe calls
also to their devm-equivalents.

This includes moving the clk- and regulator-disabling to a devm_action
so that they gets disabled both during remove and in the error case
in probe, after the action is registered.

Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/rockchip_saradc.c