[PATCH V4 1/5] arm/dt: add basic mx51 device tree support

Grant Likely grant.likely at secretlab.ca
Fri Mar 18 04:17:13 EST 2011


On Thu, Mar 17, 2011 at 09:54:35AM +0800, Shawn Guo wrote:
> On Tue, Mar 15, 2011 at 01:03:42AM -0600, Grant Likely wrote:
> > > +#ifdef CONFIG_OF
> > > +static struct clk *mx5_dt_clk_get(struct device_node *np,
> > > +					const char *output_id, void *data)
> > > +{
> > > +	return data;
> > > +}
> > > +
> > > +static __init void mx5_dt_scan_clks(void)
> > > +{
> > > +	struct device_node *node;
> > > +	struct clk *clk;
> > > +	const char *id;
> > > +	int rc;
> > > +
> > > +	for_each_compatible_node(node, NULL, "clock") {
> > > +		id = of_get_property(node, "clock-outputs", NULL);
> > > +		if (!id)
> > > +			continue;
> > > +
> > > +		clk = clk_get_sys(id, NULL);
> > > +		if (IS_ERR(clk))
> > > +			continue;
> > > +
> > > +		rc = of_clk_add_provider(node, mx5_dt_clk_get, clk);
> > > +		if (rc)
> > > +			pr_err("error adding fixed clk %s\n", node->name);
> > > +	}
> > > +}
> > > +
> > > +void __init mx5_clk_dt_init(void)
> > > +{
> > > +	mx5_dt_scan_clks();
> > > +}
> > > +#endif
> > 
> > Nitpick: Would it make sense for these 3 functions to be in a separate .c file?
> > 
> Sorry for that I'm late on this.  It will not make much sense to do
> so if considering that dynamic dt clock codes have to be put in
> clock-mx51-mx53.c anyway, since they are referring to existing
> enable/disable/get_rate/set_rate/... functions.

Okay.

g.


More information about the devicetree-discuss mailing list