Skip to contentSkip to conversation

drivers: mmc: host: use devm_ioremap_resource()

PATCH Superseded Laurent Navet 2 participants 2 messages May 12, 2013 – May 14, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: mmc: host: use devm_ioremap_resource()

eplace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_ioremap_resource.cocci

---
 drivers/mmc/host/mvsdio.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/mvsdio.c +3 -3
index 8960fc8..a66ee4b 100644
@@ -758,9 +758,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
 	spin_lock_init(&host->lock);
 
-	host->base = devm_request_and_ioremap(&pdev->dev, r);
-	if (!host->base) {
-		ret = -ENOMEM;
+	host->base = devm_ioremap_resource(&pdev->dev, r);
+	if (IS_ERR(host->base)) {
+		ret = PTR_ERR(host->base);
 		goto out;
 	}
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Laurent Navet

eplace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

CC'ed Sachin Kamat

Fix the typo: eplace -> replace

Quoted 5 lines

Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_ioremap_resource.cocci

It looks good.

Best regards,
Jingoo Han

Quoted 23 lines
---
 drivers/mmc/host/mvsdio.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/mvsdio.c +3 -4
index 8960fc8..a66ee4b 100644
@@ -758,9 +758,9 @@ static int __init mvsd_probe(struct platform_device *pdev)
 
 	spin_lock_init(&host->lock);
 
-	host->base = devm_request_and_ioremap(&pdev->dev, r);
-	if (!host->base) {
-		ret = -ENOMEM;
+	host->base = devm_ioremap_resource(&pdev->dev, r);
+	if (IS_ERR(host->base)) {
+		ret = PTR_ERR(host->base);
 		goto out;
 	}
 
--

1.7.10.4