Skip to contentSkip to conversation

ALSA: snd-aoa: two copy and paste bugs

PATCH Applied Dan Carpenter 3 participants 3 messages Nov 13, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: snd-aoa: two copy and paste bugs

These functions were cut and paste and the tests for NULL weren't updated properly.

sound/aoa/fabrics/layout.c +2 -2
index 61ab640..9dc5806 100644
@@ -644,7 +644,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol,		\
 			   struct snd_ctl_elem_value *ucontrol)		\
 {									\
 	struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol);	\
-	if (gpio->methods && gpio->methods->get_##n)			\
+	if (gpio->methods && gpio->methods->set_##n)			\
 		gpio->methods->set_##n(gpio,				\
 			!!ucontrol->value.integer.value[0]);		\
 	return 1;							\
@@ -1135,7 +1135,7 @@ static int aoa_fabric_layout_resume(struct soundbus_dev *sdev)
 {
 	struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev);
 
-	if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off)
+	if (ldev->gpio.methods && ldev->gpio.methods->all_amps_restore)
 		ldev->gpio.methods->all_amps_restore(&ldev->gpio);
 
 	return 0;
Applied
#1 lore raw

At Wed, 13 Nov 2013 10:45:20 +0300,

Quoted 5 lines · Dan Carpenter

These functions were cut and paste and the tests for NULL weren't updated properly.

Thanks, applied.

Takashi

Quoted 24 lines
sound/aoa/fabrics/layout.c +2 -2
index 61ab640..9dc5806 100644
@@ -644,7 +644,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol,		\
 			   struct snd_ctl_elem_value *ucontrol)		\
 {									\
 	struct gpio_runtime *gpio = snd_kcontrol_chip(kcontrol);	\
-	if (gpio->methods && gpio->methods->get_##n)			\
+	if (gpio->methods && gpio->methods->set_##n)			\
 		gpio->methods->set_##n(gpio,				\
 			!!ucontrol->value.integer.value[0]);		\
 	return 1;							\
@@ -1135,7 +1135,7 @@ static int aoa_fabric_layout_resume(struct soundbus_dev *sdev)
 {
 	struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev);
 
-	if (ldev->gpio.methods && ldev->gpio.methods->all_amps_off)
+	if (ldev->gpio.methods && ldev->gpio.methods->all_amps_restore)
 		ldev->gpio.methods->all_amps_restore(&ldev->gpio);
 
 	return 0;
maintainer
#2 lore raw
Quoted 9 lines · Takashi Iwai

At Wed, 13 Nov 2013 10:45:20 +0300,

Quoted 5 lines · Dan Carpenter

These functions were cut and paste and the tests for NULL weren't updated properly.

Thanks, applied.

FWIW, looks fine to me - I wonder how long this has been broken though, must be practically forever. I guess we never got it wrong and missed adding some pointers? :-)

johannes