Skip to contentSkip to conversation

echoaudio 2/2

PATCH In review Giuliano Pochini 2 participants 2 messages Mar 26, 2005 – Mar 29, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 echoaudio 2/2

- Minor cleanup: move range checking inside the clt callback.

Common subdirectories: alsa-driver_1_automute/pci/echoaudio/CVS and alsa-driver/pci/echoaudio/CVS

pci/echoaudio/echoaudio.c +7 -9
diff -du alsa-driver_1_automute/pci/echoaudio/echoaudio.c alsa-driver/pci/echoaudio/echoaudio.c
@@ -1455,9 +1455,6 @@
 /******************* Phantom power switch *******************/
 static int snd_echo_phantom_power_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
 {
-	echoaudio_t *chip;
-
-	chip = snd_kcontrol_chip(kcontrol);
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
 	uinfo->count = 1;
 	uinfo->value.integer.min = 0;
@@ -1468,22 +1465,23 @@
 static int snd_echo_phantom_power_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
 {
 	echoaudio_t *chip = snd_kcontrol_chip(kcontrol);
+
 	ucontrol->value.integer.value[0] = chip->phantom_power;
 	return 0;
 }
 
 static int snd_echo_phantom_power_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)
 {
-	echoaudio_t *chip;
-	int changed = 0;
+	echoaudio_t *chip = snd_kcontrol_chip(kcontrol);
+	int power, changed = 0;
 
-	chip = snd_kcontrol_chip(kcontrol);
-	if (chip->phantom_power != !!ucontrol->value.integer.value[0]) {
+	power = !!ucontrol->value.integer.value[0];
+	if (chip->phantom_power != power) {
 		spin_lock_irq(&chip->lock);
-		changed = set_phantom_power(chip, ucontrol->value.integer.value[0]);
+		changed = set_phantom_power(chip, power);
+		spin_unlock_irq(&chip->lock);
 		if (changed == 0)
 			changed = 1;	/* no errors */
-		spin_unlock_irq(&chip->lock);
 	}
 	return changed;
 }
pci/echoaudio/gina3g_dsp.c +1 -1
diff -du alsa-driver_1_automute/pci/echoaudio/gina3g_dsp.c alsa-driver/pci/echoaudio/gina3g_dsp.c
@@ -106,7 +106,7 @@
 	else
 		control_reg &= ~E3G_PHANTOM_POWER;
 
-	chip->phantom_power = !!on;
+	chip->phantom_power = on;
 	return write_control_reg(chip, control_reg, le32_to_cpu(chip->comm_page->e3g_frq_register), 0);
 }
 

--
Giuliano.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

#1 lore raw

At Sat, 26 Mar 2005 23:32:55 +0100,

Quoted 5 lines · Giuliano Pochini

- Minor cleanup: move range checking inside the clt callback.

Both patches are applied to CVS now.

Thanks.

Takashi

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click