Skip to contentSkip to conversation

drivers: ata: rcar: use devm_ioremap_resource()

PATCH In review Silviu-Mihai Popescu 2 participants 2 messages Apr 12, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: ata: rcar: use devm_ioremap_resource()

Convert use of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. This was found with coccinelle.

---
 drivers/ata/sata_rcar.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/sata_rcar.c +3 -3
index caf33f6..8c51a3a 100644
@@ -799,9 +799,9 @@ static int sata_rcar_probe(struct platform_device *pdev)
 
 	host->private_data = priv;
 
-	priv->base = devm_request_and_ioremap(&pdev->dev, mem);
-	if (!priv->base) {
-		ret = -EADDRNOTAVAIL;
+	priv->base = devm_ioremap_resource(&pdev->dev, mem);
+	if (IS_ERR(priv->base)) {
+		ret = PTR_ERR(priv->base);
 		goto cleanup;
 	}
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 17 lines · Silviu-Mihai Popescu

Convert use of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() which provides more consistent error handling. This was found with coccinelle.

---
  drivers/ata/sata_rcar.c |    6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/sata_rcar.c +0 -0
index caf33f6..8c51a3a 100644
@@ -799,9 +799,9 @@ static int sata_rcar_probe(struct platform_device *pdev)
 
  	host->private_data = priv;

drivers/ata/sata_rcar.c static int sata_rcar_probe(struct platform_device *pdev) · line 807

Quoted 10 lines
drivers/ata/sata_rcar.c +3 -3
 
-	priv->base = devm_request_and_ioremap(&pdev->dev, mem);
-	if (!priv->base) {
-		ret = -EADDRNOTAVAIL;
+	priv->base = devm_ioremap_resource(&pdev->dev, mem);
+	if (IS_ERR(priv->base)) {
+		ret = PTR_ERR(priv->base);
  		goto cleanup;
  	}
 

See 2de1d5e159ccf317a9285a0dfaa6e4262500d7dd in libata-dev.git#upstream.

Jeff