From: Takashi Iwai Subject: Re: [PATCH] us122l: add snd_us122l_free() Date: Fri, 17 Apr 2009 09:04:43 +0200 Message-ID: References: <200904161938.50539.fzu@wemgehoertderstaat.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 32CC0103800 for ; Fri, 17 Apr 2009 09:04:43 +0200 (CEST) In-Reply-To: <200904161938.50539.fzu@wemgehoertderstaat.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Karsten Wiese Cc: alsa-devel@alsa-project.org, stable@kernel.org List-Id: alsa-devel@alsa-project.org 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 > 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 > + * Copyright (C) 2007-2009 Karsten Wiese > * > * 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 "); > -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 >