[PATCH 4/4 v2] net/smsc911x: Provide common clock functionality

Lee Jones lee.jones at linaro.org
Thu Dec 27 14:31:24 EST 2012


No, you're right, I'm a moron.

Will fix up and resend when I'm back to work.

Sent from my mobile Linux device.
On Dec 26, 2012 12:51 AM, "Linus Walleij" <linus.walleij at linaro.org> wrote:

> On Fri, Dec 21, 2012 at 12:41 PM, Lee Jones <lee.jones at linaro.org> wrote:
>
> > +       if (IS_ERR(pdata->clk)) {
> > +               ret = clk_prepare_enable(pdata->clk);
> > +               if (ret < 0)
> > +                       netdev_err(ndev, "failed to enable clock %d\n",
> ret);
> > +       }
>
> I think you got all of these backwards now, shouldn't it be if
> (!IS_ERR(pdata->clk)) { } ...?
>
> It's late here but enlighten me if I don't get it.
>
> > +       if (IS_ERR(pdata->clk))
> > +               clk_disable_unprepare(pdata->clk);
>
> Dito.
>
> > +       /* Request clock */
> > +       pdata->clk = clk_get(&pdev->dev, NULL);
> > +       if (IS_ERR(pdata->clk))
> > +               netdev_warn(ndev, "couldn't get clock %li\n",
> PTR_ERR(pdata->clk));
>
> This one seems correct though.
>
> > +       /* Free clock */
> > +       if (IS_ERR(pdata->clk)) {
> > +               clk_put(pdata->clk);
> > +               pdata->clk = NULL;
> > +       }
>
> Should be !IS_ERR()
>
> Yours,
> Linus Walleij
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121227/73803030/attachment-0001.html>


More information about the linux-arm-kernel mailing list