From: Sergei Shtylyov <sshtylyov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
To: Vaibhav Bedia <vaibhav.bedia-l0cyMroinI0@public.gmane.org>
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
Subject: Re: [PATCH] ASoC: Davinci: Replace use of IO_ADDRESS with ioremap()
Date: Thu, 16 Dec 2010 14:12:57 +0300 [thread overview]
Message-ID: <4D09F439.9010404@mvista.com> (raw)
In-Reply-To: <1292491018-24491-1-git-send-email-vaibhav.bedia-l0cyMroinI0@public.gmane.org>
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
next prev parent reply other threads:[~2010-12-16 11:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D09F439.9010404@mvista.com \
--to=sshtylyov-igf4poytycdqt0dzr+alfa@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
--cc=lrg-kDsPt+C1G03kYMGBc/C6ZA@public.gmane.org \
--cc=vaibhav.bedia-l0cyMroinI0@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox