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.

Reply via email to