alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Sebastien Guiriec <s-guiriec@ti.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH] ASoC: omap-mcpdm: Clean up with devm_* function
Date: Wed, 13 Feb 2013 14:17:09 +0100	[thread overview]
Message-ID: <511B9255.7090505@ti.com> (raw)
In-Reply-To: <1360740114-4117-1-git-send-email-s-guiriec@ti.com>

On 02/13/2013 08:21 AM, Sebastien Guiriec wrote:
> Clean up McPDM driver with devm_ function.

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

> 
> Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
> ---
>  sound/soc/omap/omap-mcpdm.c |   14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
> index 5ca11bd..079f277 100644
> --- a/sound/soc/omap/omap-mcpdm.c
> +++ b/sound/soc/omap/omap-mcpdm.c
> @@ -369,7 +369,7 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai)
>  	pm_runtime_get_sync(mcpdm->dev);
>  	omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, 0x00);
>  
> -	ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler,
> +	ret = devm_request_irq(mcpdm->dev, mcpdm->irq, omap_mcpdm_irq_handler,
>  				0, "McPDM", (void *)mcpdm);
>  
>  	pm_runtime_put_sync(mcpdm->dev);
> @@ -389,7 +389,6 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai)
>  {
>  	struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai);
>  
> -	free_irq(mcpdm->irq, (void *)mcpdm);
>  	pm_runtime_disable(mcpdm->dev);
>  
>  	return 0;
> @@ -465,14 +464,11 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
>  	if (res == NULL)
>  		return -ENOMEM;
>  
> -	if (!devm_request_mem_region(&pdev->dev, res->start,
> -				     resource_size(res), "McPDM"))
> -		return -EBUSY;
> -
> -	mcpdm->io_base = devm_ioremap(&pdev->dev, res->start,
> -				      resource_size(res));
> -	if (!mcpdm->io_base)
> +	mcpdm->io_base = devm_request_and_ioremap(&pdev->dev, res);
> +	if (!mcpdm->io_base) {
> +		dev_err(&pdev->dev, "cannot remap\n");
>  		return -ENOMEM;
> +	}
>  
>  	mcpdm->irq = platform_get_irq(pdev, 0);
>  	if (mcpdm->irq < 0)
> 


-- 
Péter

  reply	other threads:[~2013-02-13 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13  7:21 [PATCH] ASoC: omap-mcpdm: Clean up with devm_* function Sebastien Guiriec
2013-02-13 13:17 ` Peter Ujfalusi [this message]
2013-02-13 13:20 ` 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=511B9255.7090505@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jarkko.nikula@bitmer.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=s-guiriec@ti.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;
as well as URLs for NNTP newsgroup(s).