Skip to contentSkip to conversation

cpuidle: clps711x: convert to devm_platform_ioremap_resource

PATCH Applied Yangtao Li 4 participants 9 messages Dec 15, 2019 – Dec 20, 2019 CPU idle time management framework

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 cpuidle: clps711x: convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-clps711x.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-clps711x.c +1 -4
index 6e36740f5719..fc22c59b6c73 100644
@@ -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);
 
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 cpuidle: kirkwood: convert to devm_platform_ioremap_resource

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-kirkwood.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-kirkwood.c +1 -4
index d23d8f468c12..511c4f46027a 100644
@@ -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);
 
Signature · 1 line
2.17.1
#3 lore raw

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

In reply to Yangtao Li
Quoted 14 lines · CET Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-kirkwood.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-kirkwood.c +0 -0
index d23d8f468c12..511c4f46027a 100644
@@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = {
 /* Initialize CPU idle by registering the idle states */

drivers/cpuidle/cpuidle-kirkwood.c static struct cpuidle_driver kirkwood_idle_driver = { · line 61

Quoted 10 lines
drivers/cpuidle/cpuidle-kirkwood.c +1 -4
 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?

#4 lore raw

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

Quoted 19 lines · Rafael J. Wysocki
Quoted 18 lines · CET Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-kirkwood.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-kirkwood.c +0 -3
index d23d8f468c12..511c4f46027a 100644
@@ -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);
Quoted 8 lines

drivers/cpuidle/cpuidle-kirkwood.c static struct cpuidle_driver kirkwood_idle_driver = { · line 61

Quoted 6 lines
drivers/cpuidle/cpuidle-kirkwood.c +1 -1
-	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?

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#5 lore raw

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

In reply to Yangtao Li
Quoted 14 lines · CET Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-kirkwood.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-kirkwood.c +0 -0
index d23d8f468c12..511c4f46027a 100644
@@ -55,10 +55,7 @@ static struct cpuidle_driver kirkwood_idle_driver = {
 /* Initialize CPU idle by registering the idle states */

drivers/cpuidle/cpuidle-kirkwood.c static struct cpuidle_driver kirkwood_idle_driver = { · line 61

Quoted 10 lines
drivers/cpuidle/cpuidle-kirkwood.c +1 -4
 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!

#6 lore raw
In reply to Yangtao Li
Quoted 14 lines · CET Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-clps711x.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-clps711x.c +0 -0
index 6e36740f5719..fc22c59b6c73 100644
@@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
 

drivers/cpuidle/cpuidle-clps711x.c static struct cpuidle_driver clps711x_idle_driver = { · line 43

Quoted 10 lines
drivers/cpuidle/cpuidle-clps711x.c +1 -4
 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?

#7 lore raw
Quoted 14 lines · Rafael J. Wysocki
Quoted 13 lines · CET Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-clps711x.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-clps711x.c +0 -0
index 6e36740f5719..fc22c59b6c73 100644
@@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
 
Quoted 13 lines

drivers/cpuidle/cpuidle-clps711x.c static struct cpuidle_driver clps711x_idle_driver = { · line 43

Quoted 11 lines
drivers/cpuidle/cpuidle-clps711x.c +1 -4
 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.

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#8 lore raw
In reply to Yangtao Li
Quoted 14 lines · CET Yangtao Li

Use devm_platform_ioremap_resource() to simplify code.

---
 drivers/cpuidle/cpuidle-clps711x.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/cpuidle/cpuidle-clps711x.c +0 -0
index 6e36740f5719..fc22c59b6c73 100644
@@ -37,10 +37,7 @@ static struct cpuidle_driver clps711x_idle_driver = {
 

drivers/cpuidle/cpuidle-clps711x.c static struct cpuidle_driver clps711x_idle_driver = { · line 43

Quoted 10 lines
drivers/cpuidle/cpuidle-clps711x.c +1 -4
 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!