Skip to contentSkip to conversation

mmc: owl-mmc: Use devm_platform_get_and_ioremap_resource()

PATCH In review Yang Li 3 participants 4 messages Mar 15, 2023 – Mar 23, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 mmc: owl-mmc: Use devm_platform_get_and_ioremap_resource()

According to commit 890cc39a8799 ("drivers: provide devm_platform_get_and_ioremap_resource()"), convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does.

---
 drivers/mmc/host/owl-mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/owl-mmc.c +1 -2
index 3dc143b03939..6f9d31a886ba 100644
@@ -578,8 +578,7 @@ static int owl_mmc_probe(struct platform_device *pdev)
 	owl_host->mmc = mmc;
 	spin_lock_init(&owl_host->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	owl_host->base = devm_ioremap_resource(&pdev->dev, res);
+	owl_host->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(owl_host->base)) {
 		ret = PTR_ERR(owl_host->base);
 		goto err_free_host;
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 16 lines · Yang Li

According to commit 890cc39a8799 ("drivers: provide devm_platform_get_and_ioremap_resource()"), convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does.

---
 drivers/mmc/host/owl-mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/owl-mmc.c +0 -0
index 3dc143b03939..6f9d31a886ba 100644

drivers/mmc/host/owl-mmc.c static int owl_mmc_probe(struct platform_device *pdev) · line 581

Quoted 4 lines
drivers/mmc/host/owl-mmc.c +0 -1
@@ -578,8 +578,7 @@ static int owl_mmc_probe(struct platform_device *pdev)
 	owl_host->mmc = mmc;
 	spin_lock_init(&owl_host->lock);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

You forgot to remove the local variable which is now unused.

Thanks,
Mani

Quoted 8 lines
drivers/mmc/host/owl-mmc.c +1 -1
-	owl_host->base = devm_ioremap_resource(&pdev->dev, res);
+	owl_host->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(owl_host->base)) {
 		ret = PTR_ERR(owl_host->base);
 		goto err_free_host;
Signature · 1 line
2.20.1.7.g153144c
Signature · 6 lines
மணிவண்ணன் சதாசிவம்

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Reviewed-by
#2 lore raw
Quoted 20 lines · Manivannan Sadhasivam
Quoted 19 lines · Yang Li

According to commit 890cc39a8799 ("drivers: provide devm_platform_get_and_ioremap_resource()"), convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does.

---
 drivers/mmc/host/owl-mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/owl-mmc.c +0 -0
index 3dc143b03939..6f9d31a886ba 100644
@@ -578,8 +578,7 @@ static int owl_mmc_probe(struct platform_device *pdev)
 	owl_host->mmc = mmc;
 	spin_lock_init(&owl_host->lock);
 
Quoted 4 lines

drivers/mmc/host/owl-mmc.c static int owl_mmc_probe(struct platform_device *pdev) · line 581

Quoted 1 line
drivers/mmc/host/owl-mmc.c +0 -1
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

You forgot to remove the local variable which is now unused.

Oops, no my bad. It is being used...

Thanks,
Mani

Quoted 14 lines

Thanks,
Mani

Quoted 8 lines
drivers/mmc/host/owl-mmc.c +1 -1
-	owl_host->base = devm_ioremap_resource(&pdev->dev, res);
+	owl_host->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(owl_host->base)) {
 		ret = PTR_ERR(owl_host->base);
 		goto err_free_host;
Signature · 1 line
2.20.1.7.g153144c
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw
In reply to Yang Li
Quoted 8 lines · Yang Li

According to commit 890cc39a8799 ("drivers: provide devm_platform_get_and_ioremap_resource()"), convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does.

Applied for next, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/owl-mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/owl-mmc.c +1 -3
index 3dc143b03939..6f9d31a886ba 100644
@@ -578,8 +578,7 @@ static int owl_mmc_probe(struct platform_device *pdev)
        owl_host->mmc = mmc;
        spin_lock_init(&owl_host->lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       owl_host->base = devm_ioremap_resource(&pdev->dev, res);
+       owl_host->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(owl_host->base)) {
                ret = PTR_ERR(owl_host->base);
                goto err_free_host;
--

2.20.1.7.g153144c