Re: [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table

2017-01-13 Thread Stephen Boyd
On 01/10, Viresh Kumar wrote: > On 09-01-17, 15:36, Stephen Boyd wrote: > > > It would be better to have _find_opp_table() > > return the pointer with the reference already taken so that we > > don't have to update callers with reference grabbing calls. > > Typically if a function returns a

Re: [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table

2017-01-13 Thread Stephen Boyd
On 01/10, Viresh Kumar wrote: > On 09-01-17, 15:36, Stephen Boyd wrote: > > > It would be better to have _find_opp_table() > > return the pointer with the reference already taken so that we > > don't have to update callers with reference grabbing calls. > > Typically if a function returns a

Re: [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table

2017-01-09 Thread Viresh Kumar
On 09-01-17, 15:36, Stephen Boyd wrote: > On 12/07, Viresh Kumar wrote: > > @@ -894,8 +895,36 @@ static void _kfree_device_rcu(struct rcu_head *head) > > kfree_rcu(opp_table, rcu_head); > > } > > > > -static void _free_opp_table(struct opp_table *opp_table) > > +void

Re: [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table

2017-01-09 Thread Viresh Kumar
On 09-01-17, 15:36, Stephen Boyd wrote: > On 12/07, Viresh Kumar wrote: > > @@ -894,8 +895,36 @@ static void _kfree_device_rcu(struct rcu_head *head) > > kfree_rcu(opp_table, rcu_head); > > } > > > > -static void _free_opp_table(struct opp_table *opp_table) > > +void

Re: [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table

2017-01-09 Thread Stephen Boyd
On 12/07, Viresh Kumar wrote: > @@ -894,8 +895,36 @@ static void _kfree_device_rcu(struct rcu_head *head) > kfree_rcu(opp_table, rcu_head); > } > > -static void _free_opp_table(struct opp_table *opp_table) > +void _get_opp_table_kref(struct opp_table *opp_table) > { > +

Re: [PATCH 02/12] PM / OPP: Add 'struct kref' to OPP table

2017-01-09 Thread Stephen Boyd
On 12/07, Viresh Kumar wrote: > @@ -894,8 +895,36 @@ static void _kfree_device_rcu(struct rcu_head *head) > kfree_rcu(opp_table, rcu_head); > } > > -static void _free_opp_table(struct opp_table *opp_table) > +void _get_opp_table_kref(struct opp_table *opp_table) > { > +