[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACxGe6u=oph84k4uS6V3EJN=aiQfHxVOGPahOuWB4Vfx-6bEHA@mail.gmail.com>
Date: Wed, 16 Nov 2011 11:54:38 -0700
From: Grant Likely <grant.likely@...retlab.ca>
To: Rob Herring <robherring2@...il.com>
Cc: devicetree-discuss@...ts.ozlabs.org,
linux-arm-kernel@...ts.infradead.org,
Sascha Hauer <kernel@...gutronix.de>,
Rob Herring <rob.herring@...xeda.com>,
Jeremy Kerr <jeremy.kerr@...onical.com>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC 7/8] arm/clkdev: lookup clocks from OF clock providers
On Tue, Nov 8, 2011 at 7:36 PM, Rob Herring <robherring2@...il.com> wrote:
> On 11/08/2011 07:19 PM, Grant Likely wrote:
>> From: Jeremy Kerr <jeremy.kerr@...onical.com>
>>
>> Hook the OF clock provider infrastructure to clk_get.
>>
>> Signed-off-by: Jeremy Kerr <jeremy.kerr@...onical.com>
>> Signed-off-by: Grant Likely <grant.likely@...retlab.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;
Fixed, thanks.
g.
--
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