From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Axel Lin <axel.lin@ingics.com>, Mark Brown <broonie@kernel.org>
Cc: "Vipin Kumar" <vipin.kumar@st.com>,
alsa-devel@alsa-project.org,
"Thomas Niederprüm" <niederp@physik.uni-kl.de>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Jyri Sarha" <jsarha@ti.com>
Subject: Re: [PATCH 2/3] ASoC: omap-mcbsp: Convert to use devm_ioremap_resource
Date: Mon, 24 Aug 2015 13:28:06 +0300 [thread overview]
Message-ID: <55DAF1B6.2050605@ti.com> (raw)
In-Reply-To: <1440406145.27868.2.camel@ingics.com>
On 08/24/2015 11:49 AM, Axel Lin wrote:
> Use devm_ioremap_resource() instead of open code.
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> sound/soc/omap/mcbsp.c | 20 +++++---------------
> 1 file changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
> index 68a1252..c7563e2 100644
> --- a/sound/soc/omap/mcbsp.c
> +++ b/sound/soc/omap/mcbsp.c
> @@ -965,25 +965,15 @@ int omap_mcbsp_init(struct platform_device *pdev)
> mcbsp->free = true;
>
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
> - if (!res) {
> + if (!res)
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res) {
> - dev_err(mcbsp->dev, "invalid memory resource\n");
> - return -ENOMEM;
> - }
> - }
> - if (!devm_request_mem_region(&pdev->dev, res->start, resource_size(res),
> - dev_name(&pdev->dev))) {
> - dev_err(mcbsp->dev, "memory region already claimed\n");
> - return -ENODEV;
> - }
> +
> + mcbsp->io_base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(mcbsp->io_base))
> + return PTR_ERR(mcbsp->io_base);
>
> mcbsp->phys_base = res->start;
> mcbsp->reg_cache_size = resource_size(res);
> - mcbsp->io_base = devm_ioremap(&pdev->dev, res->start,
> - resource_size(res));
> - if (!mcbsp->io_base)
> - return -ENOMEM;
>
> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
> if (!res)
>
--
Péter
next prev parent reply other threads:[~2015-08-24 10:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 8:47 [PATCH 1/3] ASoC: davinci: Convert to use devm_ioremap_resource Axel Lin
2015-08-24 8:49 ` [PATCH 2/3] ASoC: omap-mcbsp: " Axel Lin
2015-08-24 10:28 ` Peter Ujfalusi [this message]
2015-08-25 9:36 ` Applied "ASoC: omap-mcbsp: Convert to use devm_ioremap_resource" to the asoc tree Mark Brown
2015-08-24 8:52 ` [PATCH 3/3] ASoC: SPEAr: Convert to use devm_ioremap_resource Axel Lin
2015-08-25 9:36 ` Applied "ASoC: SPEAr: Convert to use devm_ioremap_resource" to the asoc tree Mark Brown
2015-08-24 10:27 ` [PATCH 1/3] ASoC: davinci: Convert to use devm_ioremap_resource Peter Ujfalusi
2015-08-25 9:36 ` Applied "ASoC: davinci: Convert to use devm_ioremap_resource" to the asoc tree Mark Brown
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=55DAF1B6.2050605@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=jsarha@ti.com \
--cc=lgirdwood@gmail.com \
--cc=niederp@physik.uni-kl.de \
--cc=vipin.kumar@st.com \
/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