diff options
Diffstat (limited to 'sound/usb/usx2y/us122l.c')
-rw-r--r-- | sound/usb/usx2y/us122l.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 012ff1f6f8af..a5aae9d67f31 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -474,6 +474,14 @@ static bool us122l_create_card(struct snd_card *card) | |||
474 | return true; | 474 | return true; |
475 | } | 475 | } |
476 | 476 | ||
477 | static void snd_us122l_free(struct snd_card *card) | ||
478 | { | ||
479 | struct us122l *us122l = US122L(card); | ||
480 | int index = us122l->chip.index; | ||
481 | if (index >= 0 && index < SNDRV_CARDS) | ||
482 | snd_us122l_card_used[index] = 0; | ||
483 | } | ||
484 | |||
477 | static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp) | 485 | static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp) |
478 | { | 486 | { |
479 | int dev; | 487 | int dev; |
@@ -490,7 +498,7 @@ static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp) | |||
490 | if (err < 0) | 498 | if (err < 0) |
491 | return err; | 499 | return err; |
492 | snd_us122l_card_used[US122L(card)->chip.index = dev] = 1; | 500 | snd_us122l_card_used[US122L(card)->chip.index = dev] = 1; |
493 | 501 | card->private_free = snd_us122l_free; | |
494 | US122L(card)->chip.dev = device; | 502 | US122L(card)->chip.dev = device; |
495 | US122L(card)->chip.card = card; | 503 | US122L(card)->chip.card = card; |
496 | mutex_init(&US122L(card)->mutex); | 504 | mutex_init(&US122L(card)->mutex); |
@@ -584,7 +592,7 @@ static void snd_us122l_disconnect(struct usb_interface *intf) | |||
584 | } | 592 | } |
585 | 593 | ||
586 | usb_put_intf(intf); | 594 | usb_put_intf(intf); |
587 | usb_put_dev(US122L(card)->chip.dev); | 595 | usb_put_dev(us122l->chip.dev); |
588 | 596 | ||
589 | while (atomic_read(&us122l->mmap_count)) | 597 | while (atomic_read(&us122l->mmap_count)) |
590 | msleep(500); | 598 | msleep(500); |