Home
last modified time | relevance | path

Searched hist:"0 be844470eb929dd2a1388c6dc6d7d6ea2edaf2e" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/iio/adc/
H A Dlpc18xx_adc.cdiff 0be844470eb929dd2a1388c6dc6d7d6ea2edaf2e Fri Oct 15 13:47:12 CDT 2021 André Gustavo Nakagomi Lopez <andregnl@usp.br> iio: adc: lpc18xx_adc: Convert probe to device managed version

The remove function and the goto sections are not necessary if devm
functions are used.

Convert device register to devm version. Add hook functions to release
device resources, and use them inside probe with devm_add_action,
which will release resources on driver detach.

To maintain the order of which device resources were released/reseted,
register the hook functions as soon as resources are obtained/initialized.
Since devres actions are called on driver detach, the remove
function and the error-handling goto sections are no longer necessary.

Signed-off-by: André Gustavo Nakagomi Lopez <andregnl@usp.br>
Link: https://lore.kernel.org/r/YWnMsGlc/I35gYvy@Andryuu.br
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>