diff mbox series

cpuidle: clps711x: convert to devm_platform_ioremap_resource

Message ID 20191215130206.30265-1-tiny.windzz@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series cpuidle: clps711x: convert to devm_platform_ioremap_resource | expand

Commit Message

Yangtao Li Dec. 15, 2019, 1:02 p.m. UTC
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
 drivers/cpuidle/cpuidle-clps711x.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Rafael J. Wysocki Dec. 16, 2019, 11:20 a.m. UTC | #1
On Sunday, December 15, 2019 2:02:05 PM CET Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/cpuidle/cpuidle-clps711x.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-clps711x.c b/drivers/cpuidle/cpuidle-clps711x.c
> index 6e36740f5719..fc22c59b6c73 100644
> --- a/drivers/cpuidle/cpuidle-clps711x.c
> +++ b/drivers/cpuidle/cpuidle-clps711x.c
> @@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
>  
>  static int __init clps711x_cpuidle_probe(struct platform_device *pdev)
>  {
> -	struct resource *res;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	clps711x_halt = devm_ioremap_resource(&pdev->dev, res);
> +	clps711x_halt = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(clps711x_halt))
>  		return PTR_ERR(clps711x_halt);
>  
> 

Daniel, any concerns here?
Daniel Lezcano Dec. 16, 2019, 3:44 p.m. UTC | #2
On 16/12/2019 12:20, Rafael J. Wysocki wrote:
> On Sunday, December 15, 2019 2:02:05 PM CET Yangtao Li wrote:
>> Use devm_platform_ioremap_resource() to simplify code.
>>
>> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
>> ---
>>  drivers/cpuidle/cpuidle-clps711x.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/cpuidle/cpuidle-clps711x.c b/drivers/cpuidle/cpuidle-clps711x.c
>> index 6e36740f5719..fc22c59b6c73 100644
>> --- a/drivers/cpuidle/cpuidle-clps711x.c
>> +++ b/drivers/cpuidle/cpuidle-clps711x.c
>> @@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
>>  
>>  static int __init clps711x_cpuidle_probe(struct platform_device *pdev)
>>  {
>> -	struct resource *res;
>> -
>> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -	clps711x_halt = devm_ioremap_resource(&pdev->dev, res);
>> +	clps711x_halt = devm_platform_ioremap_resource(pdev, 0);
>>  	if (IS_ERR(clps711x_halt))
>>  		return PTR_ERR(clps711x_halt);
>>  
>>
> 
> Daniel, any concerns here?

I'm fine with those changes also. Maybe a bit more elaborated changelog,
but not sure it is worth to resend a new patch for that. May be you can
just update it with an answer and Rafael can take it into account.

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Rafael J. Wysocki Dec. 20, 2019, 9:17 a.m. UTC | #3
On Sunday, December 15, 2019 2:02:05 PM CET Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/cpuidle/cpuidle-clps711x.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-clps711x.c b/drivers/cpuidle/cpuidle-clps711x.c
> index 6e36740f5719..fc22c59b6c73 100644
> --- a/drivers/cpuidle/cpuidle-clps711x.c
> +++ b/drivers/cpuidle/cpuidle-clps711x.c
> @@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
>  
>  static int __init clps711x_cpuidle_probe(struct platform_device *pdev)
>  {
> -	struct resource *res;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	clps711x_halt = devm_ioremap_resource(&pdev->dev, res);
> +	clps711x_halt = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(clps711x_halt))
>  		return PTR_ERR(clps711x_halt);
>  
> 

Applied as 5.6 material, thanks!
diff mbox series

Patch

diff --git a/drivers/cpuidle/cpuidle-clps711x.c b/drivers/cpuidle/cpuidle-clps711x.c
index 6e36740f5719..fc22c59b6c73 100644
--- a/drivers/cpuidle/cpuidle-clps711x.c
+++ b/drivers/cpuidle/cpuidle-clps711x.c
@@ -37,10 +37,7 @@  static struct cpuidle_driver clps711x_idle_driver = {
 
 static int __init clps711x_cpuidle_probe(struct platform_device *pdev)
 {
-	struct resource *res;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	clps711x_halt = devm_ioremap_resource(&pdev->dev, res);
+	clps711x_halt = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(clps711x_halt))
 		return PTR_ERR(clps711x_halt);