]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: sifive: Simplify clock handling with devm_clk_get_enabled()
authorPei Xiao <xiaopei01@kylinos.cn>
Thu, 19 Mar 2026 02:04:05 +0000 (10:04 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Mar 2026 19:47:41 +0000 (19:47 +0000)
commit140039c23aca067b9ff0242e3c0ce96276bb95f3
tree6cddd0765f6526c5eb93346890828ac9239dd0e0
parent8b237cb10e32791e53a13c3e96e88683a736094a
spi: sifive: Simplify clock handling with devm_clk_get_enabled()

Replace devm_clk_get() followed by clk_prepare_enable() with
devm_clk_get_enabled() for the bus clock. This reduces boilerplate code
and error handling, as the managed API automatically disables the clock
when the device is removed or if probe fails.

Remove the now-unnecessary clk_disable_unprepare() calls from the probe
error path and the remove callback. Adjust the error handling to use the
existing put_host label.

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