mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
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 <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]> Acked-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/b53e6b557b4240579933b3359dda335ff94ed5af.1675354849.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <[email protected]>