lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 26 Dec 2012 01:51:05 +0100 From: Linus Walleij <linus.walleij@...aro.org> To: Lee Jones <lee.jones@...aro.org> Cc: Russell King - ARM Linux <linux@....linux.org.uk>, Steve Glendinning <steve.glendinning@...well.net>, Robert Marklund <robert.marklund@...ricsson.com>, linus.walleij@...ricsson.com, arnd@...db.de, netdev@...r.kernel.org, linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org Subject: Re: [PATCH 4/4 v2] net/smsc911x: Provide common clock functionality On Fri, Dec 21, 2012 at 12:41 PM, Lee Jones <lee.jones@...aro.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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists