ALSA: line6: Reorganize card resource handling
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 14:54:00 +0000 (15:54 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 20 Jan 2015 07:17:16 +0000 (08:17 +0100)
This is a fairly big rewrite regarding the card resource management in
line6 drivers:

- The card creation is moved into line6_probe().  This adds the global
  destructor to private_free, so that each driver doesn't have to call
  it any longer.

- The USB disconnect callback handles the card release, thus each
  driver needs to concentrate on only its own resources.  No need to
  snd_card_*() call in the destructor.

- Fix the potential stall in disconnection by removing
  snd_card_free().   It's replaced with snd_card_free_when_closed()
  for asynchronous release.

- The only remaining operation for the card in each driver is the call
  of snd_card_register().  All the rest are dealt in the common module
  by itself.

- These ended up with removal of audio.[ch] as a result of a reduction
  of one layer.  Each driver just needs to call line6_probe().

Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 files changed:
sound/usb/line6/Makefile
sound/usb/line6/audio.c [deleted file]
sound/usb/line6/audio.h [deleted file]
sound/usb/line6/capture.c
sound/usb/line6/driver.c
sound/usb/line6/midi.c
sound/usb/line6/pcm.c
sound/usb/line6/playback.c
sound/usb/line6/pod.c
sound/usb/line6/podhd.c
sound/usb/line6/toneport.c
sound/usb/line6/variax.c

index fa3a78d..b8b3b2a 100644 (file)
@@ -1,5 +1,4 @@
 snd-usb-line6-y :=             \
-               audio.o         \
                capture.o       \
                driver.o        \
                midi.o          \
diff --cc sound/usb/line6/audio.c
Simple merge
diff --cc sound/usb/line6/audio.h
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge