linux/drivers/sh
Geert Uytterhoeven ff30bd6a66 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>
2023-02-27 10:50:48 +01:00
..
clk sh: clk: Fix clk_enable() to return 0 on NULL clk 2023-02-27 10:50:48 +01:00
intc genirq: Add and use an irq_data_update_affinity helper 2022-07-07 09:38:04 +01:00
maple maple: fix wrong return value of maple_bus_init(). 2021-09-17 14:00:09 -04:00
superhyway sh: superhyway: Simplify check in remove callback 2021-08-05 14:37:03 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pm_runtime.c