iio: adc: max11100: Use devm_ functions for rest of probe()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 16 May 2021 17:25:14 +0000 (18:25 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 3 Jun 2021 17:24:14 +0000 (18:24 +0100)
commit7169a78e398463df9201939b51935dc17b53f422
tree97205220d98075faf19263a990ca5f64140b2050
parentff9111ab3e1f01cad2318c6bc989c8bf51a570ac
iio: adc: max11100: Use devm_ functions for rest of probe()

By using devm_add_action_or_reset() to manage the regulator disable,
it becomes simple to use managed functions for all of remove.
This simplifies error handling and allows us to drop the remove()
function entirely.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210516172520.1398835-3-jic23@kernel.org
drivers/iio/adc/max11100.c