]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ti-adc12138: Simplify with devm_clk_get_enabled()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 13 Jul 2025 15:59:55 +0000 (17:59 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Aug 2025 10:57:06 +0000 (11:57 +0100)
commit9ae68c9bb12a3a6cc7df59f9ee3ff5879d97cda9
treeda8392040feca9f8b7a9e6f1bb966e797b70e455
parent49baeed7b3ba82a10749fefdb6144a3817b7ad75
iio: adc: ti-adc12138: Simplify with devm_clk_get_enabled()

Driver is getting clock and almost immediately enabling it, with the
devm_request_irq() as the only relevant code executed between, thus the
probe path and cleanups can be simplified with devm_clk_get_enabled().

Move devm_request_irq() earlier, so the interrupt handler will be
registered before clock is enabled.  This might be important in case
regulator supplies are enabled by other device driver and this device
raises interrupt immediately after clock sarts ticking.

The change does not reverse cleanup paths - first regulator will be
disabled, then clock and finally interrupt handler freed.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250713-iio-clk-get-enabled-v1-1-70abc1f9ce6c@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ti-adc12138.c