public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] spi: pl022: attempt to get sspclk by name
Date: Tue, 11 Feb 2014 16:48:29 +0100	[thread overview]
Message-ID: <33149723.ycUmvZkobH@wuerfel> (raw)
In-Reply-To: <20140211150438.GJ26684@n2100.arm.linux.org.uk>

On Tuesday 11 February 2014 15:04:38 Russell King - ARM Linux wrote:
> On Tue, Feb 11, 2014 at 03:08:06PM +0100, Arnd Bergmann wrote:
> > On Tuesday 11 February 2014, Mark Brown wrote:
> > > On Tue, Feb 11, 2014 at 11:37:09AM +0000, Mark Rutland wrote:
> > > 
> > > > -     pl022->clk = devm_clk_get(&adev->dev, NULL);
> > > > +     /*
> > > > +      * For compatibility with old DTBs and platform data, fall back to the
> > > > +      * first clock if there's not an explicitly named "sspclk" entry.
> > > > +      */
> > > > +     pl022->clk = devm_clk_get(&adev->dev, "sspclk");
> > > > +     if (IS_ERR(pl022->clk))
> > > > +             pl022->clk = devm_clk_get(&adev->dev, NULL);
> > > > +
> > > 
> > > I'll just have a bit of a grumble here and point out that this sort of
> > > stuff always worries me with the convention of using nameless clocks -
> > > it causes hassle adding further clocks.
> > 
> > I think the best solution for this is to continue with anonymous clocks
> > rather than adding names after the fact. This could be done (for DT-only
> > drivers) using the of_clk_get() interface that takes an index, or
> > we could add a generic dev_clk_get_index() or similar interface that
> > has the same behavior but also works for clkdev.
> 
> Mixing devm_* and non-devm_* interfaces doesn't work.  If you want to do
> that, devm_of_clk_get() would be a prerequisit.

Yes, good point. So if we want to do it, we would have to add a new
function anyway, there is just the question whether it should be
devm_of_clk_get() or devm_clk_get_index() if that can also work for
non-DT devices. Do you think the latter actually makes sense in
the clkdev interfaces? I'm not familiar enough with the code to
tell how that would be implemented in a reasonable way.

	Arnd

  reply	other threads:[~2014-02-11 15:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 11:37 [PATCH 0/7] primecell: make correct clock parsing possible Mark Rutland
2014-02-11 11:37 ` [PATCH 1/7] Documentation: devicetree: fix up pl011 clocks Mark Rutland
2014-02-11 11:37 ` [PATCH 2/7] serial: amba-pl011: attempt to get uartclk by name Mark Rutland
2014-02-11 11:37 ` [PATCH 3/7] Documentation: devicetree: fix up pl022 clocks Mark Rutland
2014-02-13 12:55   ` Linus Walleij
2014-02-11 11:37 ` [PATCH 4/7] spi: pl022: attempt to get sspclk by name Mark Rutland
2014-02-11 12:06   ` Mark Brown
2014-02-11 13:39     ` Mark Rutland
2014-02-11 14:08     ` Arnd Bergmann
2014-02-11 15:04       ` Russell King - ARM Linux
2014-02-11 15:48         ` Arnd Bergmann [this message]
2014-02-12 10:33       ` Mark Rutland
2014-02-12 10:55         ` Mark Brown
2014-02-12 11:21         ` Arnd Bergmann
2014-02-12 11:47           ` Mark Rutland
2014-02-12 13:03             ` Arnd Bergmann
2014-02-12 16:12               ` Mark Rutland
2014-02-12 16:22                 ` Mark Brown
2014-02-12 16:31                 ` Arnd Bergmann
2014-02-24 12:26                   ` Linus Walleij
2014-02-12 15:13             ` Mark Brown
2014-02-11 11:37 ` [PATCH 5/7] Documentation: devicetree: fix up pl18x clocks Mark Rutland
2014-02-11 11:37 ` [PATCH 6/7] mmc: arm-mmci: attempt to get mclk by name Mark Rutland
2014-02-11 11:37 ` [PATCH 7/7] Documentation: devicetree: loosen primecell clock requirements Mark Rutland
2014-02-11 12:33 ` [PATCH 0/7] primecell: make correct clock parsing possible Russell King - ARM Linux
2014-02-11 13:59   ` Mark Rutland

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=33149723.ycUmvZkobH@wuerfel \
    --to=arnd@arndb.de \
    --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