ASoC: multi-component - two cleanup patches
Hi,
Two small patches you might consider adding to the multi-component rework.
Sascha
PATCH 1/2 asoc/multi-component: remove superfluous snd_card member from snd_soc_codec
Signed-off-by Sascha Hauer <[email protected]>
--- include/sound/soc.h | 1 - sound/soc/soc-core.c | 6 +++--- sound/soc/soc-dapm.c | 6 +++--- sound/soc/soc-jack.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-)
include/sound/soc.h +0 -1
@@ -428,7 +428,6 @@ struct snd_soc_codec {struct snd_soc_codec_driver *driver;struct mutex mutex; -struct snd_card *snd_card;struct snd_soc_card *card;struct list_head list;struct list_head card_list;
sound/soc/soc-core.c +3 -3
@@ -1287,7 +1287,7 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)dev_dbg (card->dev,"probe %s dai link %d\n" , card->name, num);/* config components */ - platform->snd_card = codec->snd_card = card->snd_card; + platform->snd_card = card->snd_card; codec_dai->codec = codec; codec->card = card; cpu_dai->platform = platform;
@@ -1902,7 +1902,7 @@ EXPORT_SYMBOL_GPL(snd_soc_cnew);int snd_soc_add_controls (struct snd_soc_codec *codec,const struct snd_kcontrol_new *controls,int num_controls) { -struct snd_card *card = codec->snd_card; +struct snd_card *card = codec->card->snd_card;int err, i;for (i =0 ; i < num_controls; i++) {
@@ -2457,7 +2457,7 @@ EXPORT_SYMBOL_GPL(snd_soc_put_volsw_s8);int snd_soc_limit_volume (struct snd_soc_codec *codec,const char *name,int max) { -struct snd_card *card = codec->snd_card; +struct snd_card *card = codec->card->snd_card;struct snd_kcontrol *kctl;struct soc_mixer_control *mc;int found =0 ;
sound/soc/soc-dapm.c +3 -3
@@ -368,7 +368,7 @@ static int dapm_new_mixer(struct snd_soc_codec *codec, path->kcontrol =snd_soc_cnew (&w->kcontrols[i], w, path->long_name); - ret =snd_ctl_add (codec->snd_card, path->kcontrol); + ret =snd_ctl_add (codec->card->snd_card, path->kcontrol);if (ret <0 ) { printk(KERN_ERR "asoc: failed to add dapm kcontrol %s: %d\n", path->long_name,
@@ -396,7 +396,7 @@ static int dapm_new_mux(struct snd_soc_codec *codec, } kcontrol =snd_soc_cnew (&w->kcontrols[0 ], w, w->name); - ret =snd_ctl_add (codec->snd_card, kcontrol); + ret =snd_ctl_add (codec->card->snd_card, kcontrol);if (ret <0 ) goto err;
@@ -435,7 +435,7 @@ static inline void dapm_clear_walk(struct snd_soc_codec *codec)*/ static int snd_soc_dapm_suspend_check (struct snd_soc_dapm_widget *widget) { -int level =snd_power_get_state (widget->codec->snd_card); +int level =snd_power_get_state (widget->codec->card->snd_card);switch (level) {case SNDRV_CTL_POWER_D3hot:
sound/soc/soc-jack.c +1 -1
@@ -39,7 +39,7 @@ int snd_soc_jack_new(struct snd_soc_codec *codec, const char *id, int type,INIT_LIST_HEAD (&jack->pins);BLOCKING_INIT_NOTIFIER_HEAD (&jack->notifier); -return snd_jack_new (codec->snd_card, id, type, &jack->jack); +return snd_jack_new (codec->card->snd_card, id, type, &jack->jack); }EXPORT_SYMBOL_GPL (snd_soc_jack_new);
Signature · 1 line
1.7.1
Re: [PATCH 1/2] asoc/multi-component: remove superfluous snd_card member from snd_soc_codec
Quoted 8 lines · Sascha Hauer
Signed-off-by Sascha Hauer <[email protected]>--- include/sound/soc.h | 1 - sound/soc/soc-core.c | 6 +++--- sound/soc/soc-dapm.c | 6 +++--- sound/soc/soc-jack.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-)
Both applied.
Thanks.
Liam
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
PATCH 2/2 asoc/multi-component: remove superfluous snd_card member from snd_soc_platform
In reply to Sascha HauerSigned-off-by Sascha Hauer <[email protected]>
--- include/sound/soc.h | 1 - sound/soc/soc-core.c | 1 - 2 files changed, 0 insertions(+), 2 deletions(-)
include/sound/soc.h +0 -1
@@ -526,7 +526,6 @@ struct snd_soc_platform { unsigned int suspended:1; /* platform is suspended */ unsigned int probed:1; -struct snd_card *snd_card;struct snd_soc_card *card;struct list_head list;struct list_head card_list;
sound/soc/soc-core.c +0 -1
@@ -1287,7 +1287,6 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)dev_dbg (card->dev,"probe %s dai link %d\n" , card->name, num);/* config components */ - platform->snd_card = card->snd_card; codec_dai->codec = codec; codec->card = card; cpu_dai->platform = platform;
Signature · 1 line
1.7.1