From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] net/smsc911x: Provide common clock functionality
Date: Fri, 21 Dec 2012 09:13:06 +0000 [thread overview]
Message-ID: <20121221091306.GO2691@gmail.com> (raw)
In-Reply-To: <20121220205113.GD14363@n2100.arm.linux.org.uk>
On Thu, 20 Dec 2012, Russell King - ARM Linux wrote:
> On Thu, Dec 20, 2012 at 08:35:14PM +0000, Lee Jones wrote:
> > On Thu, 20 Dec 2012, Russell King - ARM Linux wrote:
> >
> > > On Thu, Dec 20, 2012 at 08:12:08PM +0100, Linus Walleij wrote:
> > > > On Wed, Dec 19, 2012 at 6:19 PM, Lee Jones <lee.jones@linaro.org> wrote:
> > > >
> > > > > Some platforms provide clocks which require enabling before the
> > > > > SMSC911x chip will power on. This patch uses the new common clk
> > > > > framework to do just that. If no clock is provided, it will just
> > > > > be ignored and the driver will continue to assume that no clock
> > > > > is required for the chip to run successfully.
> > > > >
> > > > > Cc: Steve Glendinning <steve.glendinning@shawell.net>
> > > > > Cc: netdev at vger.kernel.org
> > > > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > >
> > > > Seems to me like it'll do the trick.
> > > > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > >
> > > This looks fairly dangerous. What about those platforms which use this
> > > driver, but don't provide a clock for it?
> > >
> > > It looks like this will result in those platforms losing their ethernet
> > > support. There's at least a bunch of the ARM evaluation boards which
> > > make use of this driver...
> >
> > Right, but nothing should regress. If no clock is provided the driver
> > moves on during the request and will refuse to prepare, enable and
> > disable there after.
> >
> > Unless I've made a mistake somewhere? If so, I'd be happy to fixup.
>
> No, but... don't use NULL for that. Use IS_ERR(pdata->clk) instead.
I'm a bit confused. I do use IS_ERR, then if there was a problem
pdata->clk is set to NULL, then we test for NULL thereafter:
> /* Request clock */
> pdata->clk = clk_get(&pdev->dev, NULL);
> if (IS_ERR(pdata->clk)) {
> netdev_warn(ndev, "couldn't get clock %d\n", PTR_ERR(pdata->clk));
> pdata->clk = NULL;
> }
Are you saying remove "pdata->clk = NULL;" and test for IS_ERR
every time?
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2012-12-21 9:13 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 17:19 [PATCH 1/4] ARM: ux500: Provide a means to obtain the SMSC9115 clock when DT is enabled Lee Jones
2012-12-19 17:19 ` [PATCH 2/4] clk: ux500: Ensure the FMSC clock is obtainable Lee Jones
2013-01-15 23:52 ` Mike Turquette
2013-01-16 9:59 ` Lee Jones
2012-12-19 17:19 ` [PATCH 3/4] clk: ux500: Provide an alias for the SMSC911x Ethernet chip Lee Jones
2013-01-09 8:56 ` Lee Jones
2013-01-09 16:26 ` Ulf Hansson
2013-01-15 23:53 ` Mike Turquette
2012-12-19 17:19 ` [PATCH 4/4] net/smsc911x: Provide common clock functionality Lee Jones
2012-12-20 19:12 ` Linus Walleij
2012-12-20 19:24 ` Russell King - ARM Linux
2012-12-20 20:35 ` Lee Jones
2012-12-20 20:51 ` Russell King - ARM Linux
2012-12-21 9:13 ` Lee Jones [this message]
2012-12-21 9:24 ` Russell King - ARM Linux
2012-12-21 11:41 ` [PATCH 4/4 v2] " Lee Jones
2012-12-26 0:51 ` Linus Walleij
2012-12-27 19:31 ` Lee Jones
2013-01-03 11:14 ` [PATCH 4/4 v3] " Lee Jones
2013-01-03 14:28 ` Linus Walleij
2013-01-07 14:16 ` Lee Jones
2013-01-09 8:55 ` Lee Jones
2013-01-09 16:32 ` Ulf Hansson
2013-01-17 10:25 ` Linus Walleij
2013-01-17 10:47 ` Lee Jones
2013-01-17 19:36 ` David Miller
2013-01-09 8:56 ` [PATCH 4/4] " Lee Jones
2012-12-20 19:09 ` [PATCH 1/4] ARM: ux500: Provide a means to obtain the SMSC9115 clock when DT is enabled Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121221091306.GO2691@gmail.com \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).