mbox series

[0/7] opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table

Message ID cover.1604646059.git.viresh.kumar@linaro.org
Headers show
Series opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table | expand

Message

Viresh Kumar Nov. 6, 2020, 7:03 a.m. UTC
Hello,

This patchset updates the dev_pm_opp_put_*() helpers to accept a NULL
pointer for the OPP table, in order to allow the callers to drop the
unnecessary checks they had to carry.

All these must get merged upstream through the OPP tree as there is a
hard dependency on the first patch here. Thanks.

Viresh Kumar (7):
  opp: Allow dev_pm_opp_put_*() APIs to accept NULL opp_table
  cpufreq: dt: dev_pm_opp_put_regulators() accepts NULL argument
  cpufreq: qcom-cpufreq-nvmem: dev_pm_opp_put_*() accepts NULL argument
  devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument
  drm/lima: dev_pm_opp_put_*() accepts NULL argument
  drm/panfrost: dev_pm_opp_put_*() accepts NULL argument
  media: venus: dev_pm_opp_put_*() accepts NULL argument

 drivers/cpufreq/cpufreq-dt.c                   |  6 ++----
 drivers/cpufreq/qcom-cpufreq-nvmem.c           | 15 ++++++---------
 drivers/devfreq/exynos-bus.c                   | 12 ++++--------
 drivers/gpu/drm/lima/lima_devfreq.c            | 13 ++++---------
 drivers/gpu/drm/panfrost/panfrost_devfreq.c    |  6 ++----
 drivers/media/platform/qcom/venus/pm_helpers.c |  3 +--
 drivers/opp/core.c                             | 18 ++++++++++++++++++
 7 files changed, 37 insertions(+), 36 deletions(-)

-- 
2.25.0.rc1.19.g042ed3e048af

Comments

Chanwoo Choi Nov. 6, 2020, 7:46 a.m. UTC | #1
On 11/6/20 4:42 PM, Chanwoo Choi wrote:
> Hi Viresh,
> 
> On 11/6/20 4:03 PM, Viresh Kumar wrote:
>> The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
>> there is no need for us to carry the extra check. Drop them.
>>
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>> ---
>>  drivers/devfreq/exynos-bus.c | 12 ++++--------
>>  1 file changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>> index 1e684a448c9e..143fd58ec3dc 100644
>> --- a/drivers/devfreq/exynos-bus.c
>> +++ b/drivers/devfreq/exynos-bus.c
>> @@ -158,10 +158,8 @@ static void exynos_bus_exit(struct device *dev)
>>  
>>  	dev_pm_opp_of_remove_table(dev);
>>  	clk_disable_unprepare(bus->clk);
>> -	if (bus->opp_table) {
>> -		dev_pm_opp_put_regulators(bus->opp_table);
>> -		bus->opp_table = NULL;
>> -	}
>> +	dev_pm_opp_put_regulators(bus->opp_table);
>> +	bus->opp_table = NULL;
>>  }
>>  
>>  static void exynos_bus_passive_exit(struct device *dev)
>> @@ -444,10 +442,8 @@ static int exynos_bus_probe(struct platform_device *pdev)
>>  	dev_pm_opp_of_remove_table(dev);
>>  	clk_disable_unprepare(bus->clk);
>>  err_reg:
>> -	if (!passive) {
>> -		dev_pm_opp_put_regulators(bus->opp_table);
>> -		bus->opp_table = NULL;
>> -	}
>> +	dev_pm_opp_put_regulators(bus->opp_table);
>> +	bus->opp_table = NULL;
>>  
>>  	return ret;
>>  }
>>
> 
> Applied it. Thanks.
> 

It seems that this patch depends on first patch.
So, need to be merged to one git repository.

Instead of applying it to devfreq.git,
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Viresh Kumar Nov. 6, 2020, 7:46 a.m. UTC | #2
On 06-11-20, 16:48, Chanwoo Choi wrote:
> On 11/6/20 4:46 PM, Chanwoo Choi wrote:

> > It seems that this patch depends on first patch.

> > So, need to be merged to one git repository.

> > 

> > Instead of applying it to devfreq.git,

> > Acked-by: Chanwoo Choi <cw00.choi@samsung.com>

> > 

> 

> Also, need to add 'PM /' prefix to patch title 

> in order to keep the same format with already merged devfreq patches.

> - 'PM / devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument'


Done, thanks.

-- 
viresh
Chanwoo Choi Nov. 6, 2020, 7:48 a.m. UTC | #3
On 11/6/20 4:46 PM, Chanwoo Choi wrote:
> On 11/6/20 4:42 PM, Chanwoo Choi wrote:
>> Hi Viresh,
>>
>> On 11/6/20 4:03 PM, Viresh Kumar wrote:
>>> The dev_pm_opp_put_*() APIs now accepts a NULL opp_table pointer and so
>>> there is no need for us to carry the extra check. Drop them.
>>>
>>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>>> ---
>>>  drivers/devfreq/exynos-bus.c | 12 ++++--------
>>>  1 file changed, 4 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>>> index 1e684a448c9e..143fd58ec3dc 100644
>>> --- a/drivers/devfreq/exynos-bus.c
>>> +++ b/drivers/devfreq/exynos-bus.c
>>> @@ -158,10 +158,8 @@ static void exynos_bus_exit(struct device *dev)
>>>  
>>>  	dev_pm_opp_of_remove_table(dev);
>>>  	clk_disable_unprepare(bus->clk);
>>> -	if (bus->opp_table) {
>>> -		dev_pm_opp_put_regulators(bus->opp_table);
>>> -		bus->opp_table = NULL;
>>> -	}
>>> +	dev_pm_opp_put_regulators(bus->opp_table);
>>> +	bus->opp_table = NULL;
>>>  }
>>>  
>>>  static void exynos_bus_passive_exit(struct device *dev)
>>> @@ -444,10 +442,8 @@ static int exynos_bus_probe(struct platform_device *pdev)
>>>  	dev_pm_opp_of_remove_table(dev);
>>>  	clk_disable_unprepare(bus->clk);
>>>  err_reg:
>>> -	if (!passive) {
>>> -		dev_pm_opp_put_regulators(bus->opp_table);
>>> -		bus->opp_table = NULL;
>>> -	}
>>> +	dev_pm_opp_put_regulators(bus->opp_table);
>>> +	bus->opp_table = NULL;
>>>  
>>>  	return ret;
>>>  }
>>>
>>
>> Applied it. Thanks.
>>
> 
> It seems that this patch depends on first patch.
> So, need to be merged to one git repository.
> 
> Instead of applying it to devfreq.git,
> Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
> 

Also, need to add 'PM /' prefix to patch title 
in order to keep the same format with already merged devfreq patches.
- 'PM / devfreq: exynos: dev_pm_opp_put_*() accepts NULL argument'