]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: uniphier: Simplify clock handling with devm_clk_get_enabled()
authorPei Xiao <xiaopei01@kylinos.cn>
Thu, 14 May 2026 04:36:30 +0000 (00:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 May 2026 15:16:33 +0000 (17:16 +0200)
commitec88a12005e565f653fd1d56822daec0186452ac
treef2a227941ef9c090cecb3a6595c2e7649cda73ed
parentb16033c8774f5fb4c0cb9b445a1dfc68f499ae6a
spi: uniphier: Simplify clock handling with devm_clk_get_enabled()

[ Upstream commit fdca270f8f87cae2eb5b619234b9dd11a863ce6b ]

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 and disable calls, as the managed API automatically
handles clock disabling on device removal or probe failure.

Remove the now-unnecessary clk_disable_unprepare() calls from the probe
error path and the remove callback. Adjust error labels accordingly.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://patch.msgid.link/b2deeefd4ef1a4bce71116aabfcb7e81400f6d37.1775546948.git.xiaopei01@kylinos.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: 0245435f7772 ("spi: uniphier: fix controller deregistration")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-uniphier.c