Re: [PATCH v2] gpio: dwapb_gpio: Enable all clocks
Marek Vasut via U-Boot <[email protected]>
| Newsgroups | gmane.comp.boot-loaders.u-boot |
|---|---|
| Message-ID | <9eb93d89-41f9-4c9b-a876-22e6f496443a__27127.7556473919$1786747464$gmane$org@mailbox.org> |
On 8/14/26 8:29 PM, Ralph Siemsen wrote:
[...]
> @@ -132,12 +134,34 @@ static int gpio_dwapb_reset(struct udevice *dev)
> return 0;
> }
>
> +static int gpio_dwapb_enable_optional_clocks(struct udevice *dev)
> +{
> + struct gpio_dwapb_priv *priv = dev_get_priv(dev);
> + int ret;
> +
> + ret = clk_get_bulk(dev, &priv->clks);
> + if (ret) {
> + /* Clocks are optional */
> + if (ret != -ENOENT)
> + dev_err(dev, "Failed to get clocks: %d\n", ret);
> + return ret;
> + }
> +
> + ret = clk_enable_bulk(&priv->clks);
> + if (ret)
> + dev_err(dev, "Failed to enable clocks: %d\n", ret);
> +
> + return ret;
> +}
> +
> static int gpio_dwapb_probe(struct udevice *dev)
> {
> struct gpio_dev_priv *priv = dev_get_uclass_priv(dev);
> struct gpio_dwapb_plat *plat = dev_get_plat(dev);
>
> if (!plat) {
> + gpio_dwapb_enable_optional_clocks(dev);
Error is not propagated from this call.
Fail path that would disable the clock is missing in this function.