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>
Showing
- sound/usb/card.c 6 additions, 3 deletionssound/usb/card.c
- sound/usb/midi.c 9 additions, 6 deletionssound/usb/midi.c
- sound/usb/midi.h 12 additions, 2 deletionssound/usb/midi.h
- sound/usb/quirks.c 21 additions, 15 deletionssound/usb/quirks.c
- sound/usb/quirks.h 2 additions, 1 deletionsound/usb/quirks.h
Loading
Please register or sign in to comment