Skip to content
Commit d86186a6 authored by Jonathan Cameron's avatar Jonathan Cameron
Browse files

iio: frequency: ad9523: Use devm_regulator_get_enable()



This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.

Note that in event of an error on the devm_regulator_get() the driver
would have continued without enabling the regulator which is probably
not a good idea.  So here we handle any error as a reason to fail the
probe(). In theory this may expose breakage on a platform that was
previously papered over but it seems low risk.

Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: default avatarNuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221016163409.320197-9-jic23@kernel.org
parent 9e855d77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment