diff mbox series

[1/2] cpuidle: kirkwood: convert to devm_platform_ioremap_resource

Message ID 20191215130206.30265-2-tiny.windzz@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series [1/2] cpuidle: kirkwood: 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-kirkwood.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Andrew Lunn Dec. 15, 2019, 3:01 p.m. UTC | #1
On Sun, Dec 15, 2019 at 01:02:06PM +0000, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Rafael J. Wysocki Dec. 16, 2019, 11:21 a.m. UTC | #2
On Sunday, December 15, 2019 2:02:06 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-kirkwood.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c
> index d23d8f468c12..511c4f46027a 100644
> --- a/drivers/cpuidle/cpuidle-kirkwood.c
> +++ b/drivers/cpuidle/cpuidle-kirkwood.c
> @@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = {
>  /* Initialize CPU idle by registering the idle states */
>  static int kirkwood_cpuidle_probe(struct platform_device *pdev)
>  {
> -	struct resource *res;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	ddr_operation_base = devm_ioremap_resource(&pdev->dev, res);
> +	ddr_operation_base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(ddr_operation_base))
>  		return PTR_ERR(ddr_operation_base);
>  
> 

Daniel, any concerns here?
Daniel Lezcano Dec. 16, 2019, 3:45 p.m. UTC | #3
On 16/12/2019 12:21, Rafael J. Wysocki wrote:
> On Sunday, December 15, 2019 2:02:06 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-kirkwood.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c
>> index d23d8f468c12..511c4f46027a 100644
>> --- a/drivers/cpuidle/cpuidle-kirkwood.c
>> +++ b/drivers/cpuidle/cpuidle-kirkwood.c
>> @@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = {
>>  /* Initialize CPU idle by registering the idle states */
>>  static int kirkwood_cpuidle_probe(struct platform_device *pdev)
>>  {
>> -	struct resource *res;
>> -
>> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -	ddr_operation_base = devm_ioremap_resource(&pdev->dev, res);
>> +	ddr_operation_base = devm_platform_ioremap_resource(pdev, 0);
>>  	if (IS_ERR(ddr_operation_base))
>>  		return PTR_ERR(ddr_operation_base);
>>  
>>
> 
> Daniel, any concerns here?

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Rafael J. Wysocki Dec. 20, 2019, 9:16 a.m. UTC | #4
On Sunday, December 15, 2019 2:02:06 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-kirkwood.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c
> index d23d8f468c12..511c4f46027a 100644
> --- a/drivers/cpuidle/cpuidle-kirkwood.c
> +++ b/drivers/cpuidle/cpuidle-kirkwood.c
> @@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = {
>  /* Initialize CPU idle by registering the idle states */
>  static int kirkwood_cpuidle_probe(struct platform_device *pdev)
>  {
> -	struct resource *res;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	ddr_operation_base = devm_ioremap_resource(&pdev->dev, res);
> +	ddr_operation_base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(ddr_operation_base))
>  		return PTR_ERR(ddr_operation_base);
>  
> 

Applied as 5.6 material, thanks!
diff mbox series

Patch

diff --git a/drivers/cpuidle/cpuidle-kirkwood.c b/drivers/cpuidle/cpuidle-kirkwood.c
index d23d8f468c12..511c4f46027a 100644
--- a/drivers/cpuidle/cpuidle-kirkwood.c
+++ b/drivers/cpuidle/cpuidle-kirkwood.c
@@ -55,10 +55,7 @@  static struct cpuidle_driver kirkwood_idle_driver = {
 /* Initialize CPU idle by registering the idle states */
 static int kirkwood_cpuidle_probe(struct platform_device *pdev)
 {
-	struct resource *res;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ddr_operation_base = devm_ioremap_resource(&pdev->dev, res);
+	ddr_operation_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ddr_operation_base))
 		return PTR_ERR(ddr_operation_base);