Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-21 Thread Viresh Kumar
On 22 May 2014 05:27, Rafael J. Wysocki wrote: > In a header file included by cpu.c. Something like > > #if defined(CONFIG_OF) && defined(CONFIG_PM_OPP) > > #else > static inline > #endif Thanks, Sudeep already helped me in understanding that :) .. Already implemented that in cpu.c only .. --

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-21 Thread Rafael J. Wysocki
On Tuesday, May 20, 2014 08:08:11 AM Viresh Kumar wrote: > On 20 May 2014 02:43, Rafael J. Wysocki wrote: > > What about > > > > if (error) > > return error; > > > > and then you'd save an indentation level? > > Yes. > > > Anyway, I find adding of_node* stuff directly to

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-21 Thread Viresh Kumar
On 21 May 2014 15:18, Sudeep Holla wrote: >> Why do we need to return anything? Let that function have return type >> 'void'? > > > Hmm, don't we still need to throw error if DT has invalid OPP ? > It doesn't may sense to me if no errors is returned and still CPUFreq fails > later. I wasn't sure

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-21 Thread Sudeep Holla
On 21/05/14 10:41, Viresh Kumar wrote: On 21 May 2014 15:05, Sudeep Holla wrote: As Rafael mentioned it's better to have a wrapper function to hide these details. You should consider the fact that of_init_opp_table returns -EINVAL if CONFIG_PM_OPP not defined as well as when the list is inval

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-21 Thread Viresh Kumar
On 21 May 2014 15:05, Sudeep Holla wrote: > As Rafael mentioned it's better to have a wrapper function to hide these > details. You should consider the fact that of_init_opp_table returns -EINVAL > if > CONFIG_PM_OPP not defined as well as when the list is invalid in the DT. > IMO we can return -E

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-21 Thread Sudeep Holla
On 19/05/14 07:29, Viresh Kumar wrote: All drivers expecting CPU's OPPs from device tree initialize OPP table using of_init_opp_table() and there is nothing driver specific in that. They all do it in the same way adding to code redundancy. It would be better if we can get rid of code redundanc

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-19 Thread Viresh Kumar
On 20 May 2014 02:46, Rafael J. Wysocki wrote: > Do patches [2-5/5] depend on this one BTW? Yes. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Plea

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-19 Thread Viresh Kumar
On 20 May 2014 02:43, Rafael J. Wysocki wrote: > What about > > if (error) > return error; > > and then you'd save an indentation level? Yes. > Anyway, I find adding of_node* stuff directly to the driver core this way > kind of disgusting as there still are platforms that

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-19 Thread Rafael J. Wysocki
On Monday, May 19, 2014 11:13:24 PM Rafael J. Wysocki wrote: > On Monday, May 19, 2014 11:59:11 AM Viresh Kumar wrote: > > All drivers expecting CPU's OPPs from device tree initialize OPP table using > > of_init_opp_table() and there is nothing driver specific in that. They all > > do it > > in th

Re: [PATCH Resend] driver/core: cpu: initialize opp table

2014-05-19 Thread Rafael J. Wysocki
On Monday, May 19, 2014 11:59:11 AM Viresh Kumar wrote: > All drivers expecting CPU's OPPs from device tree initialize OPP table using > of_init_opp_table() and there is nothing driver specific in that. They all do > it > in the same way adding to code redundancy. > > It would be better if we can

[PATCH Resend] driver/core: cpu: initialize opp table

2014-05-18 Thread Viresh Kumar
All drivers expecting CPU's OPPs from device tree initialize OPP table using of_init_opp_table() and there is nothing driver specific in that. They all do it in the same way adding to code redundancy. It would be better if we can get rid of code redundancy by initializing CPU OPPs from core code f