[PATCH v2 08/14] clk: hs: add clock support

Haojian Zhuang haojian.zhuang at linaro.org
Wed Mar 13 00:08:53 EDT 2013


On 13 March 2013 03:00, Arnd Bergmann <arnd at arndb.de> wrote:
> On Tuesday 12 March 2013, Haojian Zhuang wrote:
>> +void __init hs_init_clocks(void)
>> +{
>> +       struct device_node *node;
>> +
>> +       /* map pmctrl registers */
>> +       node = of_find_compatible_node(NULL, NULL, "hisilicon,pmctrl");
>> +       hs_clk.pmctrl = of_iomap(node, 0);
>> +       WARN_ON(!hs_clk.pmctrl);
>> +
>> +       node = of_find_compatible_node(NULL, NULL, "hisilicon,sctrl");
>> +       hs_clk.sctrl = of_iomap(node, 0);
>> +
>> +       of_clk_init(hs_clk_match);
>> +}
>
> You should be able to just use CLK_OF_DECLARE() with each member of
> hs_clk_match[] now and call of_clk_init(NULL) from platform code.
>
> This requires moving the of_iomap() calls somewhere else, but it
> could be a function that gets called by whichever setup function
> gets run first.
>
>         Arnd

Yes, it's better. I'll update it.

Regards
Haojian



More information about the linux-arm-kernel mailing list