]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: sunplus-sp7021: Simplify clock handling with devm_clk_get_enabled()
authorPei Xiao <xiaopei01@kylinos.cn>
Thu, 19 Mar 2026 02:04:10 +0000 (10:04 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Mar 2026 19:47:43 +0000 (19:47 +0000)
commitea0e916de13426dc62fc349f80bf5326adb17cea
treeac49b484438eb5ab73dc87ec9de4cd5ef5588f79
parent7da637804805cee6899c9a682227f328e94822a5
spi: sunplus-sp7021: Simplify clock handling with devm_clk_get_enabled()

Replace devm_clk_get() followed by clk_prepare_enable() with
devm_clk_get_enabled() for the clock. This removes the need for
explicit clock enable/disable calls and the custom cleanup function,
as the managed API automatically handles clock disabling on device
removal or probe failure.

Remove the now-unnecessary sp7021_spi_disable_unprepare() function
and the devm_add_action_or_reset() call.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://patch.msgid.link/fb0bc46107975cfff4eefa9ba96fe7545996ae52.1773885292.git.xiaopei01@kylinos.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sunplus-sp7021.c