<p>No, you're right, I'm a moron.</p>
<p>Will fix up and resend when I'm back to work.</p>
<p>Sent from my mobile Linux device.</p>
<div class="gmail_quote">On Dec 26, 2012 12:51 AM, "Linus Walleij" <<a href="mailto:linus.walleij@linaro.org">linus.walleij@linaro.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Dec 21, 2012 at 12:41 PM, Lee Jones <<a href="mailto:lee.jones@linaro.org">lee.jones@linaro.org</a>> wrote:<br>
<br>
> + if (IS_ERR(pdata->clk)) {<br>
> + ret = clk_prepare_enable(pdata->clk);<br>
> + if (ret < 0)<br>
> + netdev_err(ndev, "failed to enable clock %d\n", ret);<br>
> + }<br>
<br>
I think you got all of these backwards now, shouldn't it be if<br>
(!IS_ERR(pdata->clk)) { } ...?<br>
<br>
It's late here but enlighten me if I don't get it.<br>
<br>
> + if (IS_ERR(pdata->clk))<br>
> + clk_disable_unprepare(pdata->clk);<br>
<br>
Dito.<br>
<br>
> + /* Request clock */<br>
> + pdata->clk = clk_get(&pdev->dev, NULL);<br>
> + if (IS_ERR(pdata->clk))<br>
> + netdev_warn(ndev, "couldn't get clock %li\n", PTR_ERR(pdata->clk));<br>
<br>
This one seems correct though.<br>
<br>
> + /* Free clock */<br>
> + if (IS_ERR(pdata->clk)) {<br>
> + clk_put(pdata->clk);<br>
> + pdata->clk = NULL;<br>
> + }<br>
<br>
Should be !IS_ERR()<br>
<br>
Yours,<br>
Linus Walleij<br>
</blockquote></div>