]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: zynq-qspi: Simplify clock handling with devm_clk_get_enabled()
authorPei Xiao <xiaopei01@kylinos.cn>
Tue, 7 Apr 2026 09:55:08 +0000 (17:55 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 7 Apr 2026 11:52:36 +0000 (12:52 +0100)
commit1f8fd9490e3184e9a2394df2e682901a1d57ce71
tree5786738f1a551c12f16171f34306d85d3359a4b3
parent591cd656a1bf5ea94a222af5ef2ee76df029c1d2
spi: zynq-qspi: Simplify clock handling with devm_clk_get_enabled()

Replace devm_clk_get() followed by clk_prepare_enable() with
devm_clk_get_enabled() for both "pclk" and "ref_clk". This removes
the need for explicit clock enable and disable calls, as the managed
API automatically disables the clocks on device removal or probe
failure.

Remove the now-unnecessary clk_disable_unprepare() calls from the
probe error paths and the remove callback. Simplify error handling
by jumping directly to the remove_ctlr label.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/24043625f89376da36feca2408f990a85be7ab36.1775555500.git.xiaopei01@kylinos.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-zynq-qspi.c