[PATCHv2] cpufreq for freescale mx51

Yong Shen yong.shen at linaro.org
Tue Oct 19 04:31:32 EDT 2010


>
>
> > > > > >
> > > > > > +struct cpu_wp *(*get_cpu_wp)(int *wp);
> > > > > > +
> > > > >
> > > > > This is not needed.
> > > > >
> > > > This is needed, otherwise it does not pass compile.
> > >
> > > This hunk is the only change to arch/arm/mach-mx5/cpu.c and get_cpu_wp
> > > is introduced with this patch, so how can this break compilation?
> > > Also, you should move this to a header file. Otherwise you risk of
> > > having multiple (and possibly different) declarations of the same
> > > function which can lead to hard to find bugs.
> > >
> > IMHO,  get_cpu_wp is definition rather than a declaration and without it
> > there will be errors in link phase. its declaration is in
> > arch/arm/plat-mxc/include/mach/mxc.h.
>
> Of course, you are right, my bad. Isn't this function common to al
> i.MXs? In this case it should be somewhere in plat-mxc.
> Anyway, it seems very odd to me to provide a global function pointer
> which gets overwritten by the boards. For me it is more logical to
> provide a mxc_register_workpoints() function along with a
> mxc_for_each_workpoint() iterator.
>
> About this, I am thinking move  the global function pointer to
plat-mxc/cpufreq.c and add protection before call the function pointer.
Anyway, it is just about provide cpu operating points to cpufreq driver,
right? Even, mxc_register_workpoints() has to go some where in cpufreq.c and
export a declaration in a head file, also it needs to be called before
cpufreq initialization. IMO, it's merely a preference of individuals. No
offence about that, correct me:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101019/505075ec/attachment-0001.html>


More information about the linux-arm-kernel mailing list