[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120615031747.GG31565@S2101-09.ap.freescale.net>
Date: Fri, 15 Jun 2012 11:17:49 +0800
From: Shawn Guo <shawn.guo@...aro.org>
To: Rob Herring <robherring2@...il.com>
CC: <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
<devicetree-discuss@...ts.ozlabs.org>,
Grant Likely <grant.likely@...retlab.ca>,
<mturquette@...aro.org>, <sboyd@...eaurora.org>,
<skannan@...eaurora.org>, <s.hauer@...gutronix.de>,
Rob Herring <rob.herring@...xeda.com>,
Sascha Hauer <kernel@...gutronix.de>,
Mike Turquette <mturquette@...com>
Subject: Re: [PATCH v3 1/4] clk: add DT clock binding support
On Tue, Jun 12, 2012 at 09:41:48AM -0500, Rob Herring wrote:
> +struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
> +{
> + struct of_clk_provider *provider;
> + struct clk *clk = NULL;
Both clk and clkdev treat NULL as a valid clock and return ERR_PTR for
error case, while all the codes in this patch just return NULL for
error and check (clk != NULL) for valid clock.
Should we force the consistent behavior between DT and non-DT on this?
> +
> + /* Check if we have such a provider in our array */
> + mutex_lock(&of_clk_lock);
> + list_for_each_entry(provider, &of_clk_providers, link) {
> + if (provider->node == clkspec->np)
> + clk = provider->get(clkspec, provider->data);
> + if (clk)
> + break;
> + }
> + mutex_unlock(&of_clk_lock);
> +
> + return clk;
> +}
--
Regards,
Shawn
--
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