Commit a2d518fb authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Jonathan Cameron
Browse files

iio: adc: mt6577_auxadc: Simplify with device managed function



Add a device managed hook, via devm_add_action_or_reset() and
mt6577_power_off(), to power off on device detach.

Replace iio_device_register() by devm_iio_device_register() and remove
the mt6577_auxadc_remove() function used to unregister the device and
power off the device.

Remove platform_set_drvdata() from the probe function, since
platform_get_drvdata() is not used anymore.

Remove mt6577_auxadc_mod_reg() call from the probe function error path.

Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230826035402.3512033-3-ruanjinjie@huawei.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 8cbba23e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment