From: robherring2@gmail•com (Rob Herring)
To: linux-arm-kernel@lists•infradead.org
Subject: [RFC 7/8] arm/clkdev: lookup clocks from OF clock providers
Date: Tue, 08 Nov 2011 20:36:22 -0600 [thread overview]
Message-ID: <4EB9E726.2000500@gmail.com> (raw)
In-Reply-To: <1320801583-12774-8-git-send-email-grant.likely@secretlab.ca>
On 11/08/2011 07:19 PM, Grant Likely wrote:
> From: Jeremy Kerr <jeremy.kerr@canonical•com>
>
> Hook the OF clock provider infrastructure to clk_get.
>
> Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical•com>
> Signed-off-by: Grant Likely <grant.likely@secretlab•ca>
> ---
> drivers/clk/clkdev.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index 6db161f..63f81c9 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
> @@ -19,6 +19,8 @@
> #include <linux/mutex.h>
> #include <linux/clk.h>
> #include <linux/clkdev.h>
> +#include <linux/of.h>
> +#include <linux/of_clk.h>
>
> static LIST_HEAD(clocks);
> static DEFINE_MUTEX(clocks_mutex);
> @@ -78,6 +80,11 @@ EXPORT_SYMBOL(clk_get_sys);
> struct clk *clk_get(struct device *dev, const char *con_id)
> {
> const char *dev_id = dev ? dev_name(dev) : NULL;
> + struct clk *clk;
> +
Need NULL check for dev (and then init clk to NULL):
if (dev && dev->of_node)
> + clk = of_clk_get_by_name(dev->of_node, con_id);
> + if (clk && __clk_get(clk))
> + return clk;
>
> return clk_get_sys(dev_id, con_id);
> }
next prev parent reply other threads:[~2011-11-09 2:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 1:19 [RFC 0/8] Initial DT clock bindings Grant Likely
[not found] ` <1320801583-12774-8-git-send-email-grant.likely@secretlab.ca>
2011-11-09 2:36 ` Rob Herring [this message]
2011-11-16 18:54 ` [RFC 7/8] arm/clkdev: lookup clocks from OF clock providers Grant Likely
[not found] ` <1320801583-12774-9-git-send-email-grant.likely@secretlab.ca>
2011-11-09 9:31 ` [RFC 8/8] dt/arm: versatile add clock parsing Sascha Hauer
[not found] ` <1320801583-12774-7-git-send-email-grant.likely@secretlab.ca>
2011-11-09 2:49 ` [RFC 6/8] of: add clock providers Rob Herring
2011-11-14 2:14 ` Richard Zhao
2011-11-16 19:06 ` Grant Likely
2011-11-09 9:13 ` Sascha Hauer
2011-11-09 11:23 ` Cousson, Benoit
2011-11-09 11:49 ` Sascha Hauer
2011-11-11 19:57 ` Cousson, Benoit
2011-11-16 22:12 ` Grant Likely
2011-11-18 7:48 ` Sascha Hauer
2011-11-09 13:59 ` Rob Herring
2011-11-11 19:50 ` Cousson, Benoit
2011-11-09 13:31 ` Rob Herring
2011-11-09 18:39 ` Tony Lindgren
2011-11-21 15:37 ` Shawn Guo
2011-11-30 19:38 ` Grant Likely
2011-12-01 6:34 ` Shawn Guo
[not found] ` <1320801583-12774-4-git-send-email-grant.likely@secretlab.ca>
2011-11-14 3:59 ` [RFC 3/8] of: create of_phandle_args to simplify return of phandle parsing data Shawn Guo
2011-11-16 18:47 ` Grant Likely
2011-11-21 15:50 ` Shawn Guo
[not found] ` <1320801583-12774-2-git-send-email-grant.likely@secretlab.ca>
2011-12-21 10:22 ` [RFC 1/8] gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags() Michal Simek
2012-01-04 18:30 ` Grant Likely
2012-01-05 7:28 ` Michal Simek
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=4EB9E726.2000500@gmail.com \
--to=robherring2@gmail$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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