ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation
authorTakashi Iwai <tiwai@suse.de>
Mon, 11 Jan 2016 10:33:34 +0000 (11:33 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 29 Jan 2016 06:36:10 +0000 (07:36 +0100)
commit79289e24194a9d099bf18f200894832c5760cd83
tree6a686fddaaeae99cdf85f6c2645d92891bceab74
parent3ec622f40913ae036f218e5e7e92df9c1f1753d9
ALSA: usb-audio: Refer to chip->usb_id for quirks and MIDI creation

This is a preliminary patch for the later change to allow a better
quirk ID management.  In the current USB-audio code, there are a few
places looking at usb_device idVendor and idProduct fields directly
even though we have already a static member in snd_usb_audio.usb_id.
This patch modifies such codes to refer to the latter field.

For achieving this, two slightly intensive changes have been done:
- The snd_usb_audio object is set/reset via dev_getdrv() for the given
  USB device; it's needed for minimizing the changes for some existing
  quirks that take only usb_device object.

- __snd_usbmidi_create() is introduced to receive the pre-given usb_id
  argument.  The exported snd_usbmidi_create() is unchanged by calling
  this new function internally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c
sound/usb/midi.c
sound/usb/midi.h
sound/usb/quirks.c
sound/usb/quirks.h