[RFC/PATCH 4/4] pxa: convert to common clock framework
Turquette, Mike
mturquette at ti.com
Fri Mar 16 18:03:54 EDT 2012
On Fri, Mar 16, 2012 at 10:38 AM, Philipp Zabel <philipp.zabel at gmail.com> wrote:
> #define DEFINE_CK(_name, _cken, _ops) \
> -struct clk clk_##_name = { \
> - .ops = _ops, \
> + struct clk clk_##_name; \
> + static struct clk_pxa clk_pxa_##_name = { \
> + .hw = { \
> + .clk = &clk_##_name, \
> + }, \
> .cken = CKEN_##_cken, \
> + }; \
> + static struct clk clk_##_name = { \
> + .name = #_name, \
> + .ops = _ops, \
> + .hw = &clk_pxa_##_name.hw, \
> }
Hi Philipp,
It looks like your macros do not initialize the .parent_names,
.num_parents or .flags members of struct clk. __clk_init expects
those to be initialized before being called. The kerneldoc for
__clk_init states this:
http://git.linaro.org/gitweb?p=people/mturquette/linux.git;a=blob;f=include/linux/clk-private.h;h=e2cce6fa604686ea3bca0496998322bacaed854d;hb=c5836d8acd9846ec1675b269d994d96a8ee44df4#l49
You can use the macros for the basic clocks types as templates. The
gate and mux macros are good to look at since those show how to handle
a single-parent and multi-parent clock, respectively:
http://git.linaro.org/gitweb?p=people/mturquette/linux.git;a=blob;f=include/linux/clk-private.h;h=5e4312b6f5ccb1072273ce94e235874c74dd852d;hb=2508b44cd5c134691dc5d679f728bbf82af2abe0#l83
and
http://git.linaro.org/gitweb?p=people/mturquette/linux.git;a=blob;f=include/linux/clk-private.h;h=5e4312b6f5ccb1072273ce94e235874c74dd852d;hb=2508b44cd5c134691dc5d679f728bbf82af2abe0#l148
>
> #define DEFINE_CLK(_name, _ops, _rate, _delay) \
> -struct clk clk_##_name = { \
> - .ops = _ops, \
> - .rate = _rate, \
> + struct clk clk_##_name; \
> + static struct clk_pxa clk_pxa_##_name = { \
> + .hw = { \
> + .clk = &clk_##_name, \
> + }, \
> .delay = _delay, \
> + .rate = _rate, \
> + }; \
> + static struct clk clk_##_name = { \
> + .name = #_name, \
> + .ops = _ops, \
> + .hw = &clk_pxa_##_name.hw, \
> }
ditto
>
> #define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \
> -struct clk clk_##_name = { \
> - .ops = &clk_pxa2xx_cken_ops, \
> - .rate = _rate, \
> + struct clk clk_##_name; \
> + static struct clk_pxa clk_pxa_##_name = { \
> + .hw = { \
> + .clk = &clk_##_name, \
> + }, \
> .cken = CKEN_##_cken, \
> .delay = _delay, \
> + .rate = _rate, \
> + }; \
> + static struct clk clk_##_name = { \
> + .name = #_name, \
> + .ops = &clk_pxa2xx_cken_ops, \
> + .hw = &clk_pxa_##_name.hw, \
> }
ditto
Regards,
Mike
More information about the linux-arm-kernel
mailing list