Commit ba194a4d authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown

ASoC: simple-card: use snd_soc_card_set/get_drvdata

Remove asoc_simple_get_card_info macro and use snd_soc_card_set_drvdata
and snd_soc_card_get_drvdata instead.
Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 34787d0a
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <sound/simple_card.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, static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
struct asoc_simple_dai *set, struct asoc_simple_dai *set,
unsigned int daifmt) unsigned int daifmt)
...@@ -41,7 +38,8 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, ...@@ -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) 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 *codec = rtd->codec_dai;
struct snd_soc_dai *cpu = rtd->cpu_dai; struct snd_soc_dai *cpu = rtd->cpu_dai;
unsigned int daifmt = info->daifmt; unsigned int daifmt = info->daifmt;
...@@ -256,6 +254,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev) ...@@ -256,6 +254,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
cinfo->snd_card.dai_link = &cinfo->snd_link; cinfo->snd_card.dai_link = &cinfo->snd_link;
cinfo->snd_card.num_links = 1; 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); return devm_snd_soc_register_card(&pdev->dev, &cinfo->snd_card);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment