[PATCH 1/3] bus: ti-sysc: Tolerate disabled CLK
"Markus Schneider-Pargmann (TI)" <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <20260827-v2026-10-next-topic-am45-ofupstream-ti-sysc-v1-1-e2c43cecc71e@baylibre.com> |
When ti-sysc is probed in a limited SPL environment with disabled CLK relying on the ROM setup for clocks, it should still be able to probe successfully. Allow -ENOSYS as error during clk_get and clk_release. The other calls to the clock framework in this driver will return 0 when CLK is disabled. Signed-off-by: Markus Schneider-Pargmann (TI) <[email protected]> --- drivers/bus/ti-sysc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 5f9f0a0d0b7b..d0395893519c 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -55,7 +55,7 @@ static int ti_sysc_get_one_clock(struct udevice *dev, enum ti_sysc_clocks index) err = clk_get_by_name(dev, name, &priv->clocks[index]); if (err) { - if (err == -ENODATA) + if (err == -ENODATA || err == -ENOSYS) return 0; dev_err(dev, "failed to get %s clock\n", name); @@ -71,10 +71,12 @@ static int ti_sysc_put_clocks(struct udevice *dev) int err; err = clk_release_all(priv->clocks, priv->clocks_count); - if (err) + if (err && err != -ENOSYS) { dev_err(dev, "failed to release all clocks\n"); + return err; + } - return err; + return 0; } static int ti_sysc_get_clocks(struct udevice *dev) -- 2.55.0