Skip to contentSkip to conversation

ASoC: omap-dmic: Clean up with devm_request_and_ioremap

PATCH Applied Sebastien Guiriec 3 participants 3 messages Feb 13, 2013

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

PATCH 1/1 ASoC: omap-dmic: Clean up with devm_request_and_ioremap

Clean up dmic code with devm_request_and_ioremap function.

---
 sound/soc/omap/omap-dmic.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
sound/soc/omap/omap-dmic.c +2 -9
index ba49ccd..77e9e7e 100644
@@ -493,16 +493,9 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 		goto err_put_clk;
 	}
 
-	if (!devm_request_mem_region(&pdev->dev, res->start,
-				     resource_size(res), pdev->name)) {
-		dev_err(dmic->dev, "memory region already claimed\n");
-		ret = -ENODEV;
-		goto err_put_clk;
-	}
-
-	dmic->io_base = devm_ioremap(&pdev->dev, res->start,
-				     resource_size(res));
+	dmic->io_base = devm_request_and_ioremap(&pdev->dev, res);
 	if (!dmic->io_base) {
+		dev_err(&pdev->dev, "cannot remap\n");
 		ret = -ENOMEM;
 		goto err_put_clk;
 	}
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Sebastien Guiriec

Clean up dmic code with devm_request_and_ioremap function.

Quoted 30 lines
---
 sound/soc/omap/omap-dmic.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
sound/soc/omap/omap-dmic.c +2 -9
index ba49ccd..77e9e7e 100644
@@ -493,16 +493,9 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 		goto err_put_clk;
 	}
 
-	if (!devm_request_mem_region(&pdev->dev, res->start,
-				     resource_size(res), pdev->name)) {
-		dev_err(dmic->dev, "memory region already claimed\n");
-		ret = -ENODEV;
-		goto err_put_clk;
-	}
-
-	dmic->io_base = devm_ioremap(&pdev->dev, res->start,
-				     resource_size(res));
+	dmic->io_base = devm_request_and_ioremap(&pdev->dev, res);
 	if (!dmic->io_base) {
+		dev_err(&pdev->dev, "cannot remap\n");
 		ret = -ENOMEM;
 		goto err_put_clk;
 	}
Signature · 5 lines
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html