]> git.ipfire.org Git - thirdparty/linux.git/commit
gpio: rockchip: convert bank->clk to devm_clk_get_enabled()
authorMarco Scardovi <scardracs@disroot.org>
Tue, 26 May 2026 17:02:45 +0000 (19:02 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 28 May 2026 13:23:40 +0000 (15:23 +0200)
commit3e46c18d5d87f063a93ae0fe7662fbf6660459d5
treeaea6d6ee7211112545004c6edbc555313b83aa9f
parent8a122b5e72cc0043705f0d524bcd15f0c0b3ec15
gpio: rockchip: convert bank->clk to devm_clk_get_enabled()

The bank->clk was previously obtained via of_clk_get() and manually
prepared/enabled. However, it was missing a corresponding clk_put() in
both the error paths and the remove function, leading to a reference leak.

Convert the allocation to devm_clk_get_enabled(), which also properly
propagates failures from clk_prepare_enable() that were previously ignored.

The GPIO bank device uses the same OF node as the previous of_clk_get()
call, so devm_clk_get_enabled(dev, NULL) correctly resolves the same
clock provider entry.

Fix the reference leak and simplify the code by removing the manual
clk_disable_unprepare() calls in the probe error paths and in the
remove function.

Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio")
Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Link: https://patch.msgid.link/20260526171050.12785-2-scardracs@disroot.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-rockchip.c