All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap()
@ 2010-12-16  9:16 Vaibhav Bedia
       [not found] ` <1292491018-24491-1-git-send-email-vaibhav.bedia-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Vaibhav Bedia @ 2010-12-16  9:16 UTC (permalink / raw)
  To: alsa-devel; +Cc: davinci-linux-open-source, broonie, Vaibhav Bedia, lrg

This patch modifies the Davinci i2s and mcasp drivers to use ioremap()
instead of IO_ADDRESS

Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
---
 sound/soc/davinci/davinci-i2s.c   |   15 +++++++++++----
 sound/soc/davinci/davinci-mcasp.c |   16 ++++++++++++----
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 9e0e565..5395fad 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -694,7 +694,12 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 	}
 	clk_enable(dev->clk);
 
-	dev->base = (void __iomem *)IO_ADDRESS(mem->start);
+	dev->base = ioremap(mem->start, resource_size(mem));
+	if (!dev->base) {
+		dev_err(&pdev->dev, "ioremap failed\n");
+		ret = -ENOMEM;
+		goto err_ioremap;
+	}
 
 	dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].dma_addr =
 	    (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DXR_REG);
@@ -707,7 +712,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 	if (!res) {
 		dev_err(&pdev->dev, "no DMA resource\n");
 		ret = -ENXIO;
-		goto err_free_mem;
+		goto err_ioremap;
 	}
 	dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start;
 
@@ -715,7 +720,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 	if (!res) {
 		dev_err(&pdev->dev, "no DMA resource\n");
 		ret = -ENXIO;
-		goto err_free_mem;
+		goto err_ioremap;
 	}
 	dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start;
 	dev->dev = &pdev->dev;
@@ -724,10 +729,12 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 
 	ret = snd_soc_register_dai(&pdev->dev, &davinci_i2s_dai);
 	if (ret != 0)
-		goto err_free_mem;
+		goto err_ioremap;
 
 	return 0;
 
+err_ioremap:
+	iounmap(dev->base);
 err_free_mem:
 	kfree(dev);
 err_release_region:
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index fb55d2c..de61b41 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -885,7 +885,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	clk_enable(dev->clk);
 	dev->clk_active = 1;
 
-	dev->base = (void __iomem *)IO_ADDRESS(mem->start);
+	dev->base = ioremap(mem->start, resource_size(mem));
+	if (!dev->base) {
+		dev_err(&pdev->dev, "ioremap failed\n");
+		ret = -ENOMEM;
+		goto err_ioremap;
+	}
+
 	dev->op_mode = pdata->op_mode;
 	dev->tdm_slots = pdata->tdm_slots;
 	dev->num_serializer = pdata->num_serializer;
@@ -906,7 +912,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	if (!res) {
 		dev_err(&pdev->dev, "no DMA resource\n");
 		ret = -ENODEV;
-		goto err_release_region;
+		goto err_ioremap;
 	}
 
 	dma_data->channel = res->start;
@@ -921,7 +927,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	if (!res) {
 		dev_err(&pdev->dev, "no DMA resource\n");
 		ret = -ENODEV;
-		goto err_release_region;
+		goto err_ioremap;
 	}
 
 	dma_data->channel = res->start;
@@ -929,9 +935,11 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
 	ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]);
 
 	if (ret != 0)
-		goto err_release_region;
+		goto err_ioremap;
 	return 0;
 
+err_ioremap:
+	iounmap(dev->base);
 err_release_region:
 	release_mem_region(mem->start, (mem->end - mem->start) + 1);
 err_release_data:
-- 
1.6.2.4

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

* Re: [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap()
       [not found] ` <1292491018-24491-1-git-send-email-vaibhav.bedia-l0cyMroinI0@public.gmane.org>
@ 2010-12-16 11:12   ` Sergei Shtylyov
  2010-12-16 11:41     ` Bedia, Vaibhav
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2010-12-16 11:12 UTC (permalink / raw)
  To: Vaibhav Bedia
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
	lrg-kDsPt+C1G03kYMGBc/C6ZA

Hello.

On 16-12-2010 12:16, Vaibhav Bedia wrote:

> This patch modifies the Davinci i2s and mcasp drivers to use ioremap()
> instead of IO_ADDRESS

> Signed-off-by: Vaibhav Bedia<vaibhav.bedia-l0cyMroinI0@public.gmane.org>
[...]

> diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
> index 9e0e565..5395fad 100644
> --- a/sound/soc/davinci/davinci-i2s.c
> +++ b/sound/soc/davinci/davinci-i2s.c
> @@ -694,7 +694,12 @@ static int davinci_i2s_probe(struct platform_device *pdev)
>   	}
>   	clk_enable(dev->clk);
>
> -	dev->base = (void __iomem *)IO_ADDRESS(mem->start);
> +	dev->base = ioremap(mem->start, resource_size(mem));
> +	if (!dev->base) {
> +		dev_err(&pdev->dev, "ioremap failed\n");
> +		ret = -ENOMEM;
> +		goto err_ioremap;

    Why iounmap() what you've just failed to ioremap()?

> @@ -724,10 +729,12 @@ static int davinci_i2s_probe(struct platform_device *pdev)
[...]
> +err_ioremap:
> +	iounmap(dev->base);
>   err_free_mem:

    Don't you forget to call clk_disable()/clk_put()?

>   	kfree(dev);
>   err_release_region:
> diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
> index fb55d2c..de61b41 100644
> --- a/sound/soc/davinci/davinci-mcasp.c
> +++ b/sound/soc/davinci/davinci-mcasp.c
> @@ -885,7 +885,13 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
>   	clk_enable(dev->clk);
>   	dev->clk_active = 1;
>
> -	dev->base = (void __iomem *)IO_ADDRESS(mem->start);
> +	dev->base = ioremap(mem->start, resource_size(mem));
> +	if (!dev->base) {
> +		dev_err(&pdev->dev, "ioremap failed\n");
> +		ret = -ENOMEM;
> +		goto err_ioremap;

    Why iounmap() what you've just failed to ioremap()?

> @@ -929,9 +935,11 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
[...]
> +err_ioremap:
> +	iounmap(dev->base);
>   err_release_region:

    Don't you forget to call clk_disable()/clk_put()?

>   	release_mem_region(mem->start, (mem->end - mem->start) + 1);
>   err_release_data:

WBR, Sergei

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

* Re: [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap()
  2010-12-16 11:12   ` Sergei Shtylyov
@ 2010-12-16 11:41     ` Bedia, Vaibhav
       [not found]       ` <FCCFB4CDC6E5564B9182F639FC356087035F30217D-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Bedia, Vaibhav @ 2010-12-16 11:41 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
	davinci-linux-open-source@linux.davincidsp.com,
	lrg@slimlogic.co.uk

On Thursday, December 16, 2010 4:43 PM, Sergei Shtylyov wrote:
[...]
> 
>     Why iounmap() what you've just failed to ioremap()?
> 
Will fix this.

[...]
>>   err_free_mem:
> 
>     Don't you forget to call clk_disable()/clk_put()?
> 
Will fix this issue also as part of the patch.

>   	release_mem_region(mem->start, (mem->end - mem->start) + 1);
>   err_release_data:

Regards,
Vaibhav

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

* Re: [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap()
       [not found]       ` <FCCFB4CDC6E5564B9182F639FC356087035F30217D-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2010-12-16 12:49         ` Sergei Shtylyov
  2010-12-17  4:16           ` Bedia, Vaibhav
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2010-12-16 12:49 UTC (permalink / raw)
  To: Bedia, Vaibhav
  Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
	davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org,
	lrg-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org

Hello.

On 16-12-2010 14:41, Bedia, Vaibhav wrote:

>>>    err_free_mem:

>>      Don't you forget to call clk_disable()/clk_put()?

> Will fix this issue also as part of the patch.

    No, this is different issue -- please submit another patch.

>>    	release_mem_region(mem->start, (mem->end - mem->start) + 1);
>>    err_release_data:

> Regards,
> Vaibhav

WBR, Sergei

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

* Re: [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap()
  2010-12-16 12:49         ` Sergei Shtylyov
@ 2010-12-17  4:16           ` Bedia, Vaibhav
  0 siblings, 0 replies; 5+ messages in thread
From: Bedia, Vaibhav @ 2010-12-17  4:16 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
	davinci-linux-open-source@linux.davincidsp.com,
	lrg@slimlogic.co.uk

On Thursday, December 16, 2010 6:19 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 16-12-2010 14:41, Bedia, Vaibhav wrote:
> 
>>>>    err_free_mem:
> 
>>>      Don't you forget to call clk_disable()/clk_put()?
> 
>> Will fix this issue also as part of the patch.
> 
>     No, this is different issue -- please submit another patch.
> 
>>>    	release_mem_region(mem->start, (mem->end - mem->start) + 1);
>>>    err_release_data:
> 

Seems like multiple issues can be fixed in the driver. Will send patches for those also.


Regards,
Vaibhav

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

end of thread, other threads:[~2010-12-17  4:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-16  9:16 [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap() Vaibhav Bedia
     [not found] ` <1292491018-24491-1-git-send-email-vaibhav.bedia-l0cyMroinI0@public.gmane.org>
2010-12-16 11:12   ` Sergei Shtylyov
2010-12-16 11:41     ` Bedia, Vaibhav
     [not found]       ` <FCCFB4CDC6E5564B9182F639FC356087035F30217D-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-12-16 12:49         ` Sergei Shtylyov
2010-12-17  4:16           ` Bedia, Vaibhav

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.