alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] omap: convert to devm_ioremap_resource()
@ 2013-03-11 15:58 Silviu-Mihai Popescu
  2013-03-11 18:43 ` Jarkko Nikula
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Silviu-Mihai Popescu @ 2013-03-11 15:58 UTC (permalink / raw)
  To: linux-omap
  Cc: peter.ujfalusi, jarkko.nikula, lgirdwood, broonie, perex, tiwai,
	alsa-devel, linux-kernel, Silviu-Mihai Popescu

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
 sound/soc/omap/omap-dmic.c  |    9 +++------
 sound/soc/omap/omap-mcpdm.c |    8 +++-----
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index 77e9e7e..8ebaf11 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -493,12 +493,9 @@ static int asoc_dmic_probe(struct platform_device *pdev)
 		goto err_put_clk;
 	}
 
-	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;
-	}
+	dmic->io_base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(dmic->io_base))
+		return PTR_ERR(dmic->io_base);
 
 	ret = snd_soc_register_dai(&pdev->dev, &omap_dmic_dai);
 	if (ret)
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 079f277..ddfcc18 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -464,11 +464,9 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
 	if (res == NULL)
 		return -ENOMEM;
 
-	mcpdm->io_base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!mcpdm->io_base) {
-		dev_err(&pdev->dev, "cannot remap\n");
-		return -ENOMEM;
-	}
+	mcpdm->io_base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(mcpdm->io_base))
+		return PTR_ERR(mcpdm->io_base);
 
 	mcpdm->irq = platform_get_irq(pdev, 0);
 	if (mcpdm->irq < 0)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] omap: convert to devm_ioremap_resource()
  2013-03-11 15:58 [PATCH] omap: convert to devm_ioremap_resource() Silviu-Mihai Popescu
@ 2013-03-11 18:43 ` Jarkko Nikula
  2013-03-12  8:16 ` Peter Ujfalusi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Jarkko Nikula @ 2013-03-11 18:43 UTC (permalink / raw)
  To: Silviu-Mihai Popescu
  Cc: linux-omap, peter.ujfalusi, lgirdwood, broonie, perex, tiwai,
	alsa-devel, linux-kernel

Hi

On 03/11/2013 05:58 PM, Silviu-Mihai Popescu wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> 
> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.
> 
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
> ---
>  sound/soc/omap/omap-dmic.c  |    9 +++------
>  sound/soc/omap/omap-mcpdm.c |    8 +++-----
>  2 files changed, 6 insertions(+), 11 deletions(-)
> 
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] omap: convert to devm_ioremap_resource()
  2013-03-11 15:58 [PATCH] omap: convert to devm_ioremap_resource() Silviu-Mihai Popescu
  2013-03-11 18:43 ` Jarkko Nikula
@ 2013-03-12  8:16 ` Peter Ujfalusi
  2013-03-12  8:24   ` Silviu Popescu
  2013-03-12  8:32 ` Peter Ujfalusi
  2013-03-12 18:44 ` Mark Brown
  3 siblings, 1 reply; 7+ messages in thread
From: Peter Ujfalusi @ 2013-03-12  8:16 UTC (permalink / raw)
  To: Silviu-Mihai Popescu
  Cc: alsa-devel, tiwai, linux-kernel, broonie, lgirdwood, linux-omap,
	jarkko.nikula

Hi,

On 03/11/2013 04:58 PM, Silviu-Mihai Popescu wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> 
> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.

I believe both of the drivers has been patched for this:
omap-mcbpdm:
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-February/059484.html
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-February/059427.html

omap-dmic:
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-February/059485.html

and they should be already queued for next.

-- 
Péter

> 
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
> ---
>  sound/soc/omap/omap-dmic.c  |    9 +++------
>  sound/soc/omap/omap-mcpdm.c |    8 +++-----
>  2 files changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
> index 77e9e7e..8ebaf11 100644
> --- a/sound/soc/omap/omap-dmic.c
> +++ b/sound/soc/omap/omap-dmic.c
> @@ -493,12 +493,9 @@ static int asoc_dmic_probe(struct platform_device *pdev)
>  		goto err_put_clk;
>  	}
>  
> -	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;
> -	}
> +	dmic->io_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(dmic->io_base))
> +		return PTR_ERR(dmic->io_base);
>  
>  	ret = snd_soc_register_dai(&pdev->dev, &omap_dmic_dai);
>  	if (ret)
> diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
> index 079f277..ddfcc18 100644
> --- a/sound/soc/omap/omap-mcpdm.c
> +++ b/sound/soc/omap/omap-mcpdm.c
> @@ -464,11 +464,9 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
>  	if (res == NULL)
>  		return -ENOMEM;
>  
> -	mcpdm->io_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!mcpdm->io_base) {
> -		dev_err(&pdev->dev, "cannot remap\n");
> -		return -ENOMEM;
> -	}
> +	mcpdm->io_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(mcpdm->io_base))
> +		return PTR_ERR(mcpdm->io_base);
>  
>  	mcpdm->irq = platform_get_irq(pdev, 0);
>  	if (mcpdm->irq < 0)
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] omap: convert to devm_ioremap_resource()
  2013-03-12  8:16 ` Peter Ujfalusi
@ 2013-03-12  8:24   ` Silviu Popescu
  2013-03-12  8:32     ` Peter Ujfalusi
  0 siblings, 1 reply; 7+ messages in thread
From: Silviu Popescu @ 2013-03-12  8:24 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: linux-omap, jarkko.nikula, lgirdwood, broonie, perex, tiwai,
	alsa-devel, linux-kernel

On Tue, Mar 12, 2013 at 10:16 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> Hi,
>
> On 03/11/2013 04:58 PM, Silviu-Mihai Popescu wrote:
>> Convert all uses of devm_request_and_ioremap() to the newly introduced
>> devm_ioremap_resource() which provides more consistent error handling.
>>
>> devm_ioremap_resource() provides its own error messages so all explicit
>> error messages can be removed from the failure code paths.
>
> I believe both of the drivers has been patched for this:
> omap-mcbpdm:
> http://mailman.alsa-project.org/pipermail/alsa-devel/2013-February/059484.html
> http://mailman.alsa-project.org/pipermail/alsa-devel/2013-February/059427.html
>
> omap-dmic:
> http://mailman.alsa-project.org/pipermail/alsa-devel/2013-February/059485.html
>
> and they should be already queued for next.

Hello,

As far as I can tell from the mails that you have provided, those
patches replace devm_request_mem_region(), followed by devm_ioremap()
with devm_request_and_ioremap().
What this patch attempts to do is replace devm_request_and_ioremap()
with the newly introduced devm_ioremap_resource(), for the reasons
expressed in the patch body.

Thanks,
Silviu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] omap: convert to devm_ioremap_resource()
  2013-03-12  8:24   ` Silviu Popescu
@ 2013-03-12  8:32     ` Peter Ujfalusi
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2013-03-12  8:32 UTC (permalink / raw)
  To: Silviu Popescu
  Cc: alsa-devel, tiwai, linux-kernel, broonie, lgirdwood, linux-omap,
	jarkko.nikula

On 03/12/2013 09:24 AM, Silviu Popescu wrote:
> As far as I can tell from the mails that you have provided, those
> patches replace devm_request_mem_region(), followed by devm_ioremap()
> with devm_request_and_ioremap().
> What this patch attempts to do is replace devm_request_and_ioremap()
> with the newly introduced devm_ioremap_resource(), for the reasons
> expressed in the patch body.

Ah, true.

-- 
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] omap: convert to devm_ioremap_resource()
  2013-03-11 15:58 [PATCH] omap: convert to devm_ioremap_resource() Silviu-Mihai Popescu
  2013-03-11 18:43 ` Jarkko Nikula
  2013-03-12  8:16 ` Peter Ujfalusi
@ 2013-03-12  8:32 ` Peter Ujfalusi
  2013-03-12 18:44 ` Mark Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Peter Ujfalusi @ 2013-03-12  8:32 UTC (permalink / raw)
  To: Silviu-Mihai Popescu
  Cc: alsa-devel, tiwai, linux-kernel, broonie, lgirdwood, linux-omap,
	jarkko.nikula

On 03/11/2013 04:58 PM, Silviu-Mihai Popescu wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> 
> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.

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

> 
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
> ---
>  sound/soc/omap/omap-dmic.c  |    9 +++------
>  sound/soc/omap/omap-mcpdm.c |    8 +++-----
>  2 files changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
> index 77e9e7e..8ebaf11 100644
> --- a/sound/soc/omap/omap-dmic.c
> +++ b/sound/soc/omap/omap-dmic.c
> @@ -493,12 +493,9 @@ static int asoc_dmic_probe(struct platform_device *pdev)
>  		goto err_put_clk;
>  	}
>  
> -	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;
> -	}
> +	dmic->io_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(dmic->io_base))
> +		return PTR_ERR(dmic->io_base);
>  
>  	ret = snd_soc_register_dai(&pdev->dev, &omap_dmic_dai);
>  	if (ret)
> diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
> index 079f277..ddfcc18 100644
> --- a/sound/soc/omap/omap-mcpdm.c
> +++ b/sound/soc/omap/omap-mcpdm.c
> @@ -464,11 +464,9 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
>  	if (res == NULL)
>  		return -ENOMEM;
>  
> -	mcpdm->io_base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!mcpdm->io_base) {
> -		dev_err(&pdev->dev, "cannot remap\n");
> -		return -ENOMEM;
> -	}
> +	mcpdm->io_base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(mcpdm->io_base))
> +		return PTR_ERR(mcpdm->io_base);
>  
>  	mcpdm->irq = platform_get_irq(pdev, 0);
>  	if (mcpdm->irq < 0)
> 


-- 
Péter

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] omap: convert to devm_ioremap_resource()
  2013-03-11 15:58 [PATCH] omap: convert to devm_ioremap_resource() Silviu-Mihai Popescu
                   ` (2 preceding siblings ...)
  2013-03-12  8:32 ` Peter Ujfalusi
@ 2013-03-12 18:44 ` Mark Brown
  3 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2013-03-12 18:44 UTC (permalink / raw)
  To: Silviu-Mihai Popescu
  Cc: linux-omap, peter.ujfalusi, jarkko.nikula, lgirdwood, perex,
	tiwai, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]

On Mon, Mar 11, 2013 at 05:58:57PM +0200, Silviu-Mihai Popescu wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> 
> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.

Applied, thanks.  Please use subject lines appropriate to the subsystem.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-12 18:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 15:58 [PATCH] omap: convert to devm_ioremap_resource() Silviu-Mihai Popescu
2013-03-11 18:43 ` Jarkko Nikula
2013-03-12  8:16 ` Peter Ujfalusi
2013-03-12  8:24   ` Silviu Popescu
2013-03-12  8:32     ` Peter Ujfalusi
2013-03-12  8:32 ` Peter Ujfalusi
2013-03-12 18:44 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).