]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: bcmbca-hsspi: Simplify clock handling with devm_clk_get_enabled()
authorPei Xiao <xiaopei01@kylinos.cn>
Thu, 19 Mar 2026 02:03:59 +0000 (10:03 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 23 Mar 2026 19:47:40 +0000 (19:47 +0000)
commit8b237cb10e32791e53a13c3e96e88683a736094a
tree75310b5b1b856b3dd9f0bca940c7b2d82dc256a6
parente532e21a246d3fde56b7c74d6f730a16291cc96e
spi: bcmbca-hsspi: Simplify clock handling with devm_clk_get_enabled()

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

Remove the now-unnecessary clk_disable_unprepare() calls from the
probe error paths and the remove callback. Simplify the error handling
by converting to direct returns with dev_err_probe() where appropriate.

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