All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dong Aisheng <aisheng.dong@freescale.com>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: alsa-devel@alsa-project.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Dong Aisheng <dong.aisheng@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/6] ASoC: mxs: mxs-pcm does not need to be a plaform_driver
Date: Thu, 10 May 2012 17:25:55 +0800	[thread overview]
Message-ID: <20120510092554.GI6622@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <1336639333-11561-4-git-send-email-shawn.guo@linaro.org>

On Thu, May 10, 2012 at 04:42:10PM +0800, Shawn Guo wrote:
> Same as the commit 518de86 (ASoC: tegra: register 'platform' from DAIs,
> get rid of pdev), it makes mxs-pcm not a platform_driver but helper to
> register "platform", so that the platform_device for mxs-pcm can be
> saved completely.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  sound/soc/mxs/mxs-pcm.c      |   24 ++++++------------------
>  sound/soc/mxs/mxs-pcm.h      |    3 +++
>  sound/soc/mxs/mxs-saif.c     |   25 ++++---------------------
>  sound/soc/mxs/mxs-saif.h     |    1 -
>  sound/soc/mxs/mxs-sgtl5000.c |    4 ++--
>  5 files changed, 15 insertions(+), 42 deletions(-)
> 
...

> +int mxs_pcm_platform_register(struct device *dev);
> +void mxs_pcm_platform_unregister(struct device *dev);
> +
>  #endif
> diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
> index 5192db6..fa80ee6 100644
> --- a/sound/soc/mxs/mxs-saif.c
> +++ b/sound/soc/mxs/mxs-saif.c
> @@ -713,35 +713,18 @@ static int __devinit mxs_saif_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	saif->soc_platform_pdev = platform_device_alloc(
> -					"mxs-pcm-audio", pdev->id);
> -	if (!saif->soc_platform_pdev) {
> -		ret = -ENOMEM;
> -		goto failed_pdev_alloc;
> -	}
> -
> -	platform_set_drvdata(saif->soc_platform_pdev, saif);
> -	ret = platform_device_add(saif->soc_platform_pdev);
> +	ret = mxs_pcm_platform_register(&pdev->dev);
>  	if (ret) {
> -		dev_err(&pdev->dev, "failed to add soc platform device\n");
> -		goto failed_pdev_add;
> +		dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
> +		return ret;
>  	}
>  
>  	return 0;
> -
> -failed_pdev_add:
> -	platform_device_put(saif->soc_platform_pdev);
> -failed_pdev_alloc:
> -	snd_soc_unregister_dai(&pdev->dev);
Do not need to unregister_dai in case mxs_pcm_platform_register failed?

Regards
Dong Aisheng

WARNING: multiple messages have this Message-ID (diff)
From: aisheng.dong@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [PATCH 3/6] ASoC: mxs: mxs-pcm does not need to be a plaform_driver
Date: Thu, 10 May 2012 17:25:55 +0800	[thread overview]
Message-ID: <20120510092554.GI6622@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <1336639333-11561-4-git-send-email-shawn.guo@linaro.org>

On Thu, May 10, 2012 at 04:42:10PM +0800, Shawn Guo wrote:
> Same as the commit 518de86 (ASoC: tegra: register 'platform' from DAIs,
> get rid of pdev), it makes mxs-pcm not a platform_driver but helper to
> register "platform", so that the platform_device for mxs-pcm can be
> saved completely.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  sound/soc/mxs/mxs-pcm.c      |   24 ++++++------------------
>  sound/soc/mxs/mxs-pcm.h      |    3 +++
>  sound/soc/mxs/mxs-saif.c     |   25 ++++---------------------
>  sound/soc/mxs/mxs-saif.h     |    1 -
>  sound/soc/mxs/mxs-sgtl5000.c |    4 ++--
>  5 files changed, 15 insertions(+), 42 deletions(-)
> 
...

> +int mxs_pcm_platform_register(struct device *dev);
> +void mxs_pcm_platform_unregister(struct device *dev);
> +
>  #endif
> diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
> index 5192db6..fa80ee6 100644
> --- a/sound/soc/mxs/mxs-saif.c
> +++ b/sound/soc/mxs/mxs-saif.c
> @@ -713,35 +713,18 @@ static int __devinit mxs_saif_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	saif->soc_platform_pdev = platform_device_alloc(
> -					"mxs-pcm-audio", pdev->id);
> -	if (!saif->soc_platform_pdev) {
> -		ret = -ENOMEM;
> -		goto failed_pdev_alloc;
> -	}
> -
> -	platform_set_drvdata(saif->soc_platform_pdev, saif);
> -	ret = platform_device_add(saif->soc_platform_pdev);
> +	ret = mxs_pcm_platform_register(&pdev->dev);
>  	if (ret) {
> -		dev_err(&pdev->dev, "failed to add soc platform device\n");
> -		goto failed_pdev_add;
> +		dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
> +		return ret;
>  	}
>  
>  	return 0;
> -
> -failed_pdev_add:
> -	platform_device_put(saif->soc_platform_pdev);
> -failed_pdev_alloc:
> -	snd_soc_unregister_dai(&pdev->dev);
Do not need to unregister_dai in case mxs_pcm_platform_register failed?

Regards
Dong Aisheng

  reply	other threads:[~2012-05-10  9:19 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10  8:42 [PATCH 0/6] Add device tree support for mxs audio Shawn Guo
2012-05-10  8:42 ` Shawn Guo
2012-05-10  8:42 ` [PATCH 1/6] ASoC: mxs: add __devinit for mxs_saif_probe Shawn Guo
2012-05-10  8:42   ` Shawn Guo
2012-05-10  8:58   ` Dong Aisheng
2012-05-10  8:58     ` [alsa-devel] " Dong Aisheng
2012-05-10  9:32   ` Mark Brown
2012-05-10  9:32     ` Mark Brown
2012-05-10  8:42 ` [PATCH 2/6] ASoC: mxs: use devm_clk_get " Shawn Guo
2012-05-10  8:42   ` Shawn Guo
2012-05-10  9:12   ` Dong Aisheng
2012-05-10  9:12     ` [alsa-devel] " Dong Aisheng
2012-05-10  9:11     ` Shawn Guo
2012-05-10  9:11       ` [alsa-devel] " Shawn Guo
2012-05-10  9:13   ` Mark Brown
2012-05-10  9:13     ` Mark Brown
2012-05-10  9:17     ` Shawn Guo
2012-05-10  9:17       ` Shawn Guo
2012-05-10  9:30       ` Mark Brown
2012-05-10  9:30         ` Mark Brown
2012-05-10 12:01         ` Shawn Guo
2012-05-10 12:01           ` Shawn Guo
2012-05-10  8:42 ` [PATCH 3/6] ASoC: mxs: mxs-pcm does not need to be a plaform_driver Shawn Guo
2012-05-10  8:42   ` Shawn Guo
2012-05-10  9:25   ` Dong Aisheng [this message]
2012-05-10  9:25     ` [alsa-devel] " Dong Aisheng
2012-05-10 12:13     ` Shawn Guo
2012-05-10 12:13       ` [alsa-devel] " Shawn Guo
2012-05-10  8:42 ` [PATCH 4/6] ASoC: mxs: add device tree support for mxs-saif Shawn Guo
2012-05-10  8:42   ` Shawn Guo
2012-05-10  9:45   ` Dong Aisheng
2012-05-10  9:45     ` [alsa-devel] " Dong Aisheng
2012-05-10 12:14     ` Shawn Guo
2012-05-10 12:14       ` [alsa-devel] " Shawn Guo
2012-05-10  8:42 ` [PATCH 5/6] ASoC: mxs: add device tree support for mxs-sgtl5000 Shawn Guo
2012-05-10  8:42   ` Shawn Guo
2012-05-10 11:16   ` Dong Aisheng
2012-05-10 11:16     ` [alsa-devel] " Dong Aisheng
2012-05-10 12:20     ` Shawn Guo
2012-05-10 12:20       ` [alsa-devel] " Shawn Guo
2012-05-11  2:33       ` Dong Aisheng
2012-05-11  2:33         ` [alsa-devel] " Dong Aisheng
2012-05-11  2:49         ` Shawn Guo
2012-05-11  2:49           ` [alsa-devel] " Shawn Guo
2012-05-11 14:14   ` Shawn Guo
2012-05-11 14:14     ` Shawn Guo
2012-05-10  8:42 ` [PATCH 6/6] ARM: dts: enable audio support for imx28-evk Shawn Guo
2012-05-10  8:42   ` Shawn Guo
2012-05-10 11:22   ` Dong Aisheng
2012-05-10 11:22     ` [alsa-devel] " Dong Aisheng

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=20120510092554.GI6622@shlinux2.ap.freescale.net \
    --to=aisheng.dong@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dong.aisheng@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=shawn.guo@linaro.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 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.