diff mbox

ASoC: omap-dmic: Clean up with devm_request_and_ioremap

Message ID 1360740127-4154-1-git-send-email-s-guiriec@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastien Guiriec Feb. 13, 2013, 7:22 a.m. UTC
Clean up dmic code with devm_request_and_ioremap function.

Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
---
 sound/soc/omap/omap-dmic.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Peter Ujfalusi Feb. 13, 2013, 1:15 p.m. UTC | #1
On 02/13/2013 08:22 AM, Sebastien Guiriec wrote:
> Clean up dmic code with devm_request_and_ioremap function.

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
> ---
>  sound/soc/omap/omap-dmic.c |   11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
> index ba49ccd..77e9e7e 100644
> --- a/sound/soc/omap/omap-dmic.c
> +++ b/sound/soc/omap/omap-dmic.c
> @@ -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;
>  	}
>
Mark Brown Feb. 13, 2013, 1:24 p.m. UTC | #2
On Wed, Feb 13, 2013 at 08:22:07AM +0100, Sebastien Guiriec wrote:
> Clean up dmic code with devm_request_and_ioremap function.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index ba49ccd..77e9e7e 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -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;
 	}