summaryrefslogtreecommitdiff
path: root/sound/soc/generic
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2014-01-15 19:51:56 +0400
committerMark Brown <broonie@linaro.org>2014-02-03 16:45:33 +0400
commit45fce59496cbabd46761e6980c05c82d94d08eaa (patch)
treee5da21552f494e04ee2b7d6d59782ed51a6a1957 /sound/soc/generic
parentca65b492c7a265b220f763fd68bf87391213248f (diff)
downloadlinux-45fce59496cbabd46761e6980c05c82d94d08eaa.tar.xz
ASoC: simple-card: simplify code
The platform data structure contains information which is used only by the driver, and the driver allocates platform information fields which are of no use. Move the driver specific data to a new private structure and cleanup the platform data structure. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r--sound/soc/generic/simple-card.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 90c6fd5c2c7e..0f11c2808437 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -15,6 +15,14 @@
#include <linux/string.h>
#include <sound/simple_card.h>
+struct simple_card_data {
+ struct snd_soc_card snd_card;
+ unsigned int daifmt;
+ struct asoc_simple_dai cpu_dai;
+ struct asoc_simple_dai codec_dai;
+ struct snd_soc_dai_link snd_link;
+};
+
static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
struct asoc_simple_dai *set,
unsigned int daifmt)
@@ -39,7 +47,7 @@ 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 =
+ struct simple_card_data *info =
snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_dai *codec = rtd->codec_dai;
struct snd_soc_dai *cpu = rtd->cpu_dai;
@@ -121,7 +129,7 @@ parse_error:
}
static int asoc_simple_card_parse_of(struct device_node *node,
- struct asoc_simple_card_info *info,
+ struct simple_card_data *info,
struct device *dev)
{
struct snd_soc_dai_link *dai_link = info->snd_card.dai_link;
@@ -195,7 +203,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
static int asoc_simple_card_probe(struct platform_device *pdev)
{
- struct asoc_simple_card_info *priv;
+ struct simple_card_data *priv;
struct snd_soc_dai_link *dai_link;
struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev;