linux-stable/sound/usb
Julia Lawall 42a6e66f1e ALSA: sound/usb: use USB API functions rather than constants
This set of patches introduces calls to the following set of functions:

usb_endpoint_dir_in(epd)
usb_endpoint_dir_out(epd)
usb_endpoint_is_bulk_in(epd)
usb_endpoint_is_bulk_out(epd)
usb_endpoint_is_int_in(epd)
usb_endpoint_is_int_out(epd)
usb_endpoint_num(epd)
usb_endpoint_type(epd)
usb_endpoint_xfer_bulk(epd)
usb_endpoint_xfer_control(epd)
usb_endpoint_xfer_int(epd)
usb_endpoint_xfer_isoc(epd)

In some cases, introducing one of these functions is not possible, and it
just replaces an explicit integer value by one of the following constants:

USB_ENDPOINT_XFER_BULK
USB_ENDPOINT_XFER_CONTROL
USB_ENDPOINT_XFER_INT
USB_ENDPOINT_XFER_ISOC

An extract of the semantic patch that makes these changes is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@r1@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) ==
- \(USB_ENDPOINT_XFER_CONTROL\|0\))
+ usb_endpoint_xfer_control(epd)

@r5@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@inc@
@@

#include <linux/usb.h>

@depends on !inc && (r1||r5)@
@@

+ #include <linux/usb.h>
  #include <linux/usb/...>
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-01 10:27:33 +01:00
..
caiaq ALSA: snd-usb-caiaq: clean up the control adding code 2008-11-27 08:21:05 +01:00
usx2y ALSA: sound: Make static 2008-12-10 07:55:59 +01:00
Kconfig ALSA: us122l - Add missing dependency on CONFIG_SND_HWDEP 2008-09-09 09:10:57 +02:00
Makefile ALSA: Add USB US122L driver 2008-08-01 13:37:12 +02:00
usbaudio.c ALSA: usb-audio: dynamic detection of MIDI interfaces in uaxx-quirk 2008-10-10 13:41:57 +02:00
usbaudio.h ALSA: snd-usb-audio: support for Edirol UA-4FX device 2008-10-10 13:41:48 +02:00
usbmidi.c ALSA: sound/usb: use USB API functions rather than constants 2009-01-01 10:27:33 +01:00
usbmixer.c ALSA: sound/usb: use USB API functions rather than constants 2009-01-01 10:27:33 +01:00
usbmixer_maps.c
usbquirks.h ALSA: usb - Add quirk for Edirol UA-25EX advanced modes 2008-10-30 11:37:01 +01:00