diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2023-02-02 17:20:55 +0100 |
---|---|---|
committer | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | 2023-02-27 10:50:48 +0100 |
commit | ff30bd6a6618e979b16977617371c0f28a95036e (patch) | |
tree | 556084e1972bebcd7acc89a7252089ca5716fcbc /kernel/sys_ni.c | |
parent | 250870824c1cf199b032b1ef889c8e8d69d9123a (diff) | |
download | linux-ff30bd6a6618e979b16977617371c0f28a95036e.tar.gz linux-ff30bd6a6618e979b16977617371c0f28a95036e.tar.bz2 linux-ff30bd6a6618e979b16977617371c0f28a95036e.zip |
sh: clk: Fix clk_enable() to return 0 on NULL clk
On SH, devm_clk_get_optional_enabled() fails with -EINVAL if the clock
is not found. This happens because __devm_clk_get() assumes it can pass
a NULL clock pointer (as returned by clk_get_optional()) to the init()
function (clk_prepare_enable() in this case), while the SH
implementation of clk_enable() considers that an error.
Fix this by making the SH clk_enable() implementation return zero
instead, like the Common Clock Framework does.
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/b53e6b557b4240579933b3359dda335ff94ed5af.1675354849.git.geert+renesas@glider.be
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Diffstat (limited to 'kernel/sys_ni.c')
0 files changed, 0 insertions, 0 deletions