All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] echoaudio 2/2
@ 2005-03-26 22:32 Giuliano Pochini
  2005-03-29 13:59 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Giuliano Pochini @ 2005-03-26 22:32 UTC (permalink / raw)
  To: Alsa-devel


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


Signed-off-by: Giulisno Pochini <pochini@shiny.it>

Common subdirectories: alsa-driver_1_automute/pci/echoaudio/CVS and alsa-driver/pci/echoaudio/CVS
diff -du alsa-driver_1_automute/pci/echoaudio/echoaudio.c alsa-driver/pci/echoaudio/echoaudio.c
--- alsa-driver_1_automute/pci/echoaudio/echoaudio.c	Sat Mar 26 21:43:28 2005
+++ alsa-driver/pci/echoaudio/echoaudio.c	Sat Mar 26 21:45:29 2005
@@ -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;
 }
diff -du alsa-driver_1_automute/pci/echoaudio/gina3g_dsp.c alsa-driver/pci/echoaudio/gina3g_dsp.c
--- alsa-driver_1_automute/pci/echoaudio/gina3g_dsp.c	Sat Mar 26 21:43:28 2005
+++ alsa-driver/pci/echoaudio/gina3g_dsp.c	Sat Mar 26 21:45:43 2005
@@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] echoaudio 2/2
  2005-03-26 22:32 [PATCH] echoaudio 2/2 Giuliano Pochini
@ 2005-03-29 13:59 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2005-03-29 13:59 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: Alsa-devel

At Sat, 26 Mar 2005 23:32:55 +0100,
Giuliano Pochini wrote:
> 
> - Minor cleanup: move range checking inside the clt callback.
> 
> 
> Signed-off-by: Giulisno Pochini <pochini@shiny.it>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-29 13:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-26 22:32 [PATCH] echoaudio 2/2 Giuliano Pochini
2005-03-29 13:59 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.