All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCHv2 3/4] ASoC: Intel: Use devm_snd_soc_register_card
Date: Wed, 28 May 2014 12:35:39 +0300	[thread overview]
Message-ID: <1401269739-1373-1-git-send-email-jarkko.nikula@linux.intel.com> (raw)
In-Reply-To: <1401112593-2852-3-git-send-email-jarkko.nikula@linux.intel.com>

Simplify byt-rt5640.c and haswell.c machine drivers by using
devm_snd_soc_register_card(). Remove also needless dev_set_drvdata()
from byt_rt5640_probe() since snd_soc_register_card() does it too.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
v2: Fix s/devm_snd_soc_unregister_card/devm_snd_soc_register_card/ typo in
title and commit log
---
 sound/soc/intel/byt-rt5640.c | 14 +-------------
 sound/soc/intel/haswell.c    |  9 +--------
 2 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/sound/soc/intel/byt-rt5640.c b/sound/soc/intel/byt-rt5640.c
index 5535c3fb7922..7c97e1909462 100644
--- a/sound/soc/intel/byt-rt5640.c
+++ b/sound/soc/intel/byt-rt5640.c
@@ -146,25 +146,13 @@ static const struct dev_pm_ops byt_rt5640_pm_ops = {
 static int byt_rt5640_probe(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = &byt_rt5640_card;
-	struct device *dev = &pdev->dev;
 
 	card->dev = &pdev->dev;
-	dev_set_drvdata(dev, card);
-	return snd_soc_register_card(card);
-}
-
-static int byt_rt5640_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	snd_soc_unregister_card(card);
-
-	return 0;
+	return devm_snd_soc_register_card(&pdev->dev, card);
 }
 
 static struct platform_driver byt_rt5640_audio = {
 	.probe = byt_rt5640_probe,
-	.remove = byt_rt5640_remove,
 	.driver = {
 		.name = "byt-rt5640",
 		.owner = THIS_MODULE,
diff --git a/sound/soc/intel/haswell.c b/sound/soc/intel/haswell.c
index 94c2c33ffe49..3981982674ac 100644
--- a/sound/soc/intel/haswell.c
+++ b/sound/soc/intel/haswell.c
@@ -202,18 +202,11 @@ static int haswell_audio_probe(struct platform_device *pdev)
 {
 	haswell_rt5640.dev = &pdev->dev;
 
-	return snd_soc_register_card(&haswell_rt5640);
-}
-
-static int haswell_audio_remove(struct platform_device *pdev)
-{
-	snd_soc_unregister_card(&haswell_rt5640);
-	return 0;
+	return devm_snd_soc_register_card(&pdev->dev, &haswell_rt5640);
 }
 
 static struct platform_driver haswell_audio = {
 	.probe = haswell_audio_probe,
-	.remove = haswell_audio_remove,
 	.driver = {
 		.name = "haswell-audio",
 		.owner = THIS_MODULE,
-- 
2.0.0.rc2

  reply	other threads:[~2014-05-28  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 13:56 [PATCH 1/4] ASoC: Intel: Clear stored Baytrail DSP DMA pointer before stream start Jarkko Nikula
2014-05-26 13:56 ` [PATCH 2/4] ASoC: Intel: remove duplicate headers Jarkko Nikula
2014-05-26 13:56 ` [PATCH 3/4] ASoC: Intel: Use devm_snd_soc_unregister_card Jarkko Nikula
2014-05-28  9:35   ` Jarkko Nikula [this message]
2014-06-01 10:52     ` [PATCHv2 3/4] ASoC: Intel: Use devm_snd_soc_register_card Mark Brown
2014-05-26 13:56 ` [PATCH 4/4] ASoC: Intel: byt-rt5640: Use card PM ops from core Jarkko Nikula

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=1401269739-1373-1-git-send-email-jarkko.nikula@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=liam.r.girdwood@linux.intel.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 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.