lkml.org 
[lkml]   [2020]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe()
On Mon, 16 Nov 2020 10:26:07 +0100 Marco Felsch wrote:
> > > The code right above looks highly questionable as well:
> > >
> > > priv->refclk = clk_get_optional(dev, NULL);
> > > if (IS_ERR(priv->refclk))
> > > dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n");
> > >
> > > ret = clk_prepare_enable(priv->refclk);
> > > if (ret)
> > > return ret;
> > >
> > > I don't think clk_prepare_enable() will be too happy to see an error
> > > pointer. This should probably be:
> > >
> > > priv->refclk = clk_get_optional(dev, NULL);
> > > if (IS_ERR(priv->refclk))
> > > return dev_err_probe(dev, PTR_ERR(priv->refclk),
> > > "Failed to request clock\n");
> >
> > Right, especially if EPROBE_DEFER must be returned because the clock
> > provider is not ready yet, we should have a chance to do that.
>
> damn.. I missed the return here. Thanks for covering that. Should I send
> a fix or did you do that already?

Please do, I don't see any fix for this issue in patchwork right now.

\
 
 \ /
  Last update: 2020-11-16 19:09    [W:0.110 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site