Browse Source

ASoC: dapm: Don't prefix autodisable widgets twice

When a DAPM context has a prefix the autodisable widgets get prefixed
twice, once for the control and once for the widget. To avoid this use
the un-prefixed control name to construct the autodisable widget name.

This change is purely cosmetic.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Lars-Peter Clausen 9 years ago
parent
commit
41d80025a8
1 changed files with 4 additions and 4 deletions
  1. 4 4
      sound/soc/soc-dapm.c

+ 4 - 4
sound/soc/soc-dapm.c

@@ -310,7 +310,7 @@ struct dapm_kcontrol_data {
 };
 };
 
 
 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
-	struct snd_kcontrol *kcontrol)
+	struct snd_kcontrol *kcontrol, const char *ctrl_name)
 {
 {
 	struct dapm_kcontrol_data *data;
 	struct dapm_kcontrol_data *data;
 	struct soc_mixer_control *mc;
 	struct soc_mixer_control *mc;
@@ -333,7 +333,7 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 		if (mc->autodisable) {
 		if (mc->autodisable) {
 			struct snd_soc_dapm_widget template;
 			struct snd_soc_dapm_widget template;
 
 
-			name = kasprintf(GFP_KERNEL, "%s %s", kcontrol->id.name,
+			name = kasprintf(GFP_KERNEL, "%s %s", ctrl_name,
 					 "Autodisable");
 					 "Autodisable");
 			if (!name) {
 			if (!name) {
 				ret = -ENOMEM;
 				ret = -ENOMEM;
@@ -371,7 +371,7 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 		if (e->autodisable) {
 		if (e->autodisable) {
 			struct snd_soc_dapm_widget template;
 			struct snd_soc_dapm_widget template;
 
 
-			name = kasprintf(GFP_KERNEL, "%s %s", kcontrol->id.name,
+			name = kasprintf(GFP_KERNEL, "%s %s", ctrl_name,
 					 "Autodisable");
 					 "Autodisable");
 			if (!name) {
 			if (!name) {
 				ret = -ENOMEM;
 				ret = -ENOMEM;
@@ -871,7 +871,7 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
 
 
 		kcontrol->private_free = dapm_kcontrol_free;
 		kcontrol->private_free = dapm_kcontrol_free;
 
 
-		ret = dapm_kcontrol_data_alloc(w, kcontrol);
+		ret = dapm_kcontrol_data_alloc(w, kcontrol, name);
 		if (ret) {
 		if (ret) {
 			snd_ctl_free_one(kcontrol);
 			snd_ctl_free_one(kcontrol);
 			goto exit_free;
 			goto exit_free;