Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] us122l: add snd_us122l_free()
@ 2009-04-16 17:38 Karsten Wiese
  2009-04-17  7:04 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Karsten Wiese @ 2009-04-16 17:38 UTC (permalink / raw)
  To: alsa-devel; +Cc: Takashi Iwai, stable

Use it to clean up snd_us122l_card_used[].

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: stable@kernel.org
---
 sound/usb/usx2y/us122l.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index 012ff1f..e0385ce 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
+ * Copyright (C) 2007-2009 Karsten Wiese <fzu@wemgehoertderstaat.de>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -26,7 +26,7 @@
 #include "us122l.h"
 
 MODULE_AUTHOR("Karsten Wiese <fzu@wemgehoertderstaat.de>");
-MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.5");
+MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.6");
 MODULE_LICENSE("GPL");
 
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-max */
@@ -474,6 +474,14 @@ static bool us122l_create_card(struct snd_card *card)
 	return true;
 }
 
+static void snd_us122l_free(struct snd_card *card)
+{
+	struct us122l	*us122l = US122L(card);
+	int		index = us122l->chip.index;
+	if (index >= 0  &&  index < SNDRV_CARDS)
+		snd_us122l_card_used[index] = 0;
+}
+
 static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp)
 {
 	int		dev;
@@ -490,7 +498,7 @@ static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp)
 	if (err < 0)
 		return err;
 	snd_us122l_card_used[US122L(card)->chip.index = dev] = 1;
-
+	card->private_free = snd_us122l_free;
 	US122L(card)->chip.dev = device;
 	US122L(card)->chip.card = card;
 	mutex_init(&US122L(card)->mutex);
@@ -584,7 +592,7 @@ static void snd_us122l_disconnect(struct usb_interface *intf)
 	}
 
 	usb_put_intf(intf);
-	usb_put_dev(US122L(card)->chip.dev);
+	usb_put_dev(us122l->chip.dev);
 
 	while (atomic_read(&us122l->mmap_count))
 		msleep(500);
-- 
1.6.0.6

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

* Re: [PATCH] us122l: add snd_us122l_free()
  2009-04-16 17:38 [PATCH] us122l: add snd_us122l_free() Karsten Wiese
@ 2009-04-17  7:04 ` Takashi Iwai
  2009-04-17 11:38   ` Karsten Wiese
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2009-04-17  7:04 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: alsa-devel, stable

At Thu, 16 Apr 2009 19:38:50 +0200,
Karsten Wiese wrote:
> 
> Use it to clean up snd_us122l_card_used[].
> 
> Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
> Cc: stable@kernel.org

Is it really for stable kernel?  Any bug report for this?


thanks,

Takashi

> ---
>  sound/usb/usx2y/us122l.c |   16 ++++++++++++----
>  1 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
> index 012ff1f..e0385ce 100644
> --- a/sound/usb/usx2y/us122l.c
> +++ b/sound/usb/usx2y/us122l.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (C) 2007, 2008 Karsten Wiese <fzu@wemgehoertderstaat.de>
> + * Copyright (C) 2007-2009 Karsten Wiese <fzu@wemgehoertderstaat.de>
>   *
>   * This program is free software; you can redistribute it and/or modify it
>   * under the terms of the GNU General Public License as published by the
> @@ -26,7 +26,7 @@
>  #include "us122l.h"
>  
>  MODULE_AUTHOR("Karsten Wiese <fzu@wemgehoertderstaat.de>");
> -MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.5");
> +MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.6");
>  MODULE_LICENSE("GPL");
>  
>  static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-max */
> @@ -474,6 +474,14 @@ static bool us122l_create_card(struct snd_card *card)
>  	return true;
>  }
>  
> +static void snd_us122l_free(struct snd_card *card)
> +{
> +	struct us122l	*us122l = US122L(card);
> +	int		index = us122l->chip.index;
> +	if (index >= 0  &&  index < SNDRV_CARDS)
> +		snd_us122l_card_used[index] = 0;
> +}
> +
>  static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp)
>  {
>  	int		dev;
> @@ -490,7 +498,7 @@ static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp)
>  	if (err < 0)
>  		return err;
>  	snd_us122l_card_used[US122L(card)->chip.index = dev] = 1;
> -
> +	card->private_free = snd_us122l_free;
>  	US122L(card)->chip.dev = device;
>  	US122L(card)->chip.card = card;
>  	mutex_init(&US122L(card)->mutex);
> @@ -584,7 +592,7 @@ static void snd_us122l_disconnect(struct usb_interface *intf)
>  	}
>  
>  	usb_put_intf(intf);
> -	usb_put_dev(US122L(card)->chip.dev);
> +	usb_put_dev(us122l->chip.dev);
>  
>  	while (atomic_read(&us122l->mmap_count))
>  		msleep(500);
> -- 
> 1.6.0.6
> 

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

* Re: [PATCH] us122l: add snd_us122l_free()
  2009-04-17  7:04 ` Takashi Iwai
@ 2009-04-17 11:38   ` Karsten Wiese
  2009-04-17 12:06     ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Karsten Wiese @ 2009-04-17 11:38 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, stable

Am Freitag 17 April 2009 schrieb Takashi Iwai:
> At Thu, 16 Apr 2009 19:38:50 +0200,
> Karsten Wiese wrote:
> > 
> > Use it to clean up snd_us122l_card_used[].
> > 
> > Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
> > Cc: stable@kernel.org
> 
> Is it really for stable kernel?  Any bug report for this?

This really is for stable too. The bug it fixes happens if one does:

	Start on a pc with onboard soundcard at index 0.
	$ modprobe snd_usb_us122l modprobe snd_usb_us122l index=2
	plug US122L soundcard
	$ cat /proc/asound/devices
	last command shows the US122L soundcard is at index 2.

	unplug US122L soundcard
	plug US122L soundcard
	$ cat /proc/asound/devices
	last command shows the US122L soundcard is at index 1 now, which is the bug
	the patch fixes.

Thanks,
Karsten

	

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

* Re: [PATCH] us122l: add snd_us122l_free()
  2009-04-17 11:38   ` Karsten Wiese
@ 2009-04-17 12:06     ` Takashi Iwai
       [not found]       ` <20090421222043.GC24073@hera.kernel.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2009-04-17 12:06 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: alsa-devel, stable

At Fri, 17 Apr 2009 13:38:24 +0200,
Karsten Wiese wrote:
> 
> Am Freitag 17 April 2009 schrieb Takashi Iwai:
> > At Thu, 16 Apr 2009 19:38:50 +0200,
> > Karsten Wiese wrote:
> > > 
> > > Use it to clean up snd_us122l_card_used[].
> > > 
> > > Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
> > > Cc: stable@kernel.org
> > 
> > Is it really for stable kernel?  Any bug report for this?
> 
> This really is for stable too. The bug it fixes happens if one does:
> 
> 	Start on a pc with onboard soundcard at index 0.
> 	$ modprobe snd_usb_us122l modprobe snd_usb_us122l index=2
> 	plug US122L soundcard
> 	$ cat /proc/asound/devices
> 	last command shows the US122L soundcard is at index 2.
> 
> 	unplug US122L soundcard
> 	plug US122L soundcard
> 	$ cat /proc/asound/devices
> 	last command shows the US122L soundcard is at index 1 now, which is the bug
> 	the patch fixes.

OK, then please write up the problem to be fixed in the changelog,
too.


thanks,

Takashi

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

* Re: [stable] [PATCH] us122l: add snd_us122l_free()
       [not found]       ` <20090421222043.GC24073@hera.kernel.org>
@ 2009-04-22  5:42         ` Takashi Iwai
  2009-04-22 14:23           ` Chris Wright
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2009-04-22  5:42 UTC (permalink / raw)
  To: Chris Wright; +Cc: alsa-devel, stable

At Tue, 21 Apr 2009 22:20:43 +0000,
Chris Wright wrote:
> 
> * Takashi Iwai (tiwai@suse.de) wrote:
> > At Fri, 17 Apr 2009 13:38:24 +0200,
> > Karsten Wiese wrote:
> > > 
> > > Am Freitag 17 April 2009 schrieb Takashi Iwai:
> > > > At Thu, 16 Apr 2009 19:38:50 +0200,
> > > > Karsten Wiese wrote:
> > > > > 
> > > > > Use it to clean up snd_us122l_card_used[].
> > > > > 
> > > > > Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
> > > > > Cc: stable@kernel.org
> > > > 
> > > > Is it really for stable kernel?  Any bug report for this?
> > > 
> > > This really is for stable too. The bug it fixes happens if one does:
> > > 
> > > 	Start on a pc with onboard soundcard at index 0.
> > > 	$ modprobe snd_usb_us122l modprobe snd_usb_us122l index=2
> > > 	plug US122L soundcard
> > > 	$ cat /proc/asound/devices
> > > 	last command shows the US122L soundcard is at index 2.
> > > 
> > > 	unplug US122L soundcard
> > > 	plug US122L soundcard
> > > 	$ cat /proc/asound/devices
> > > 	last command shows the US122L soundcard is at index 1 now, which is the bug
> > > 	the patch fixes.
> > 
> > OK, then please write up the problem to be fixed in the changelog,
> > too.
> 
> This looks like it's still outstanding issue.

It's already in sound git tree which I'll send a pull request soon
later.  The relevant commit contains Cc to stable@kernel.org, so that
it can be handled easily (automatically?)).


thanks,

Takashi

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

* Re: [stable] [PATCH] us122l: add snd_us122l_free()
  2009-04-22  5:42         ` [stable] " Takashi Iwai
@ 2009-04-22 14:23           ` Chris Wright
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Wright @ 2009-04-22 14:23 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Chris Wright, alsa-devel, stable

* Takashi Iwai (tiwai@suse.de) wrote:
> It's already in sound git tree which I'll send a pull request soon
> later.  The relevant commit contains Cc to stable@kernel.org, so that
> it can be handled easily (automatically?)).

Perfect, thanks (yes, "Cc: stable@kernel.org" in changelog directs it to
-stable automatically).

thanks,
-chris

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

end of thread, other threads:[~2009-04-22 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 17:38 [PATCH] us122l: add snd_us122l_free() Karsten Wiese
2009-04-17  7:04 ` Takashi Iwai
2009-04-17 11:38   ` Karsten Wiese
2009-04-17 12:06     ` Takashi Iwai
     [not found]       ` <20090421222043.GC24073@hera.kernel.org>
2009-04-22  5:42         ` [stable] " Takashi Iwai
2009-04-22 14:23           ` Chris Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox