mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple-card: use snd_soc_card_set/get_drvdata
@ 2014-01-13  9:08 Xiubo Li
  2014-01-13 17:38 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Xiubo Li @ 2014-01-13  9:08 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: kuninori.morimoto.gx, alsa-devel, linux-kernel, Xiubo Li

Remove asoc_simple_get_card_info macro and use snd_soc_card_set_drvdata
and snd_soc_card_get_drvdata instead.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 sound/soc/generic/simple-card.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index dbd93cc..c025b6d 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -14,9 +14,6 @@
 #include <linux/module.h>
 #include <sound/simple_card.h>
 
-#define asoc_simple_get_card_info(p) \
-	container_of(p->dai_link, struct asoc_simple_card_info, snd_link)
-
 static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
 				       struct asoc_simple_dai *set,
 				       unsigned int daifmt)
@@ -41,7 +38,8 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
 
 static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
 {
-	struct asoc_simple_card_info *info = asoc_simple_get_card_info(rtd);
+	struct asoc_simple_card_info *info =
+				snd_soc_card_get_drvdata(rtd->card);
 	struct snd_soc_dai *codec = rtd->codec_dai;
 	struct snd_soc_dai *cpu = rtd->cpu_dai;
 	unsigned int daifmt = info->daifmt;
@@ -268,6 +266,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
 	cinfo->snd_card.dai_link	= &cinfo->snd_link;
 	cinfo->snd_card.num_links	= 1;
 
+	snd_soc_card_set_drvdata(&cinfo->snd_card, cinfo);
+
 	return devm_snd_soc_register_card(&pdev->dev, &cinfo->snd_card);
 }
 
-- 
1.8.4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: simple-card: use snd_soc_card_set/get_drvdata
  2014-01-13  9:08 [PATCH] ASoC: simple-card: use snd_soc_card_set/get_drvdata Xiubo Li
@ 2014-01-13 17:38 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-01-13 17:38 UTC (permalink / raw)
  To: Xiubo Li; +Cc: lgirdwood, kuninori.morimoto.gx, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

On Mon, Jan 13, 2014 at 05:08:08PM +0800, Xiubo Li wrote:
> Remove asoc_simple_get_card_info macro and use snd_soc_card_set_drvdata
> and snd_soc_card_get_drvdata instead.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-13 17:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-13  9:08 [PATCH] ASoC: simple-card: use snd_soc_card_set/get_drvdata Xiubo Li
2014-01-13 17:38 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®