Hi Marek,
On Wed, Sep 23, 2026 at 03:30:44PM +0200, Marek Vasut wrote:
> On 9/22/26 10:42 PM, Stefan Eichenberger wrote:
>
> Hello Stefan,
>
> > + rc = clk_get_by_name(dev, "ref", &clk);
> > + if (rc)
> > + rc = clk_get_by_name(dev, "ref_clk", &clk);
> > + /*
> > + * Only fall back to the parent node's clocks if the parent is a
> > + * dwc3 glue wrapper. When the generic node is a top level node,
> > + * the parent is not the glue device but a bus or the root device,
> > + * and its clocks are unrelated to the controller.
> > + */
> > + if (rc && dev->parent && strstr(dev->parent->driver->name, "dwc3")) {
>
> Could dev->parent->driver be NULL ?
>
It should never be NULL. This could only happen when we define it in the
root node but then it should never bind. However, I guess it's better to
be safe and check for NULL anyways in case something is really wrong. I
will add the check in the next version.
> > + rc = clk_get_by_name(dev->parent, "ref", &clk);
> > + if (rc)
> > + rc = clk_get_by_name(dev->parent, "ref_clk", &clk);
> > + }
> > + if (!rc) {
> > + priv->ref_clk = clk;
> > +
> > + rc = clk_enable(&priv->ref_clk);
> > + if (rc && rc != -ENOSYS)
> > + dev_warn(dev, "failed to enable ref clock: %d\n", rc);
>
> Shouldn't the driver fail to probe if clock cannot be enabled ?
Yes that makes sense, I will change that in the next version.
Regards,
Stefan