1. 04 Jan, 2009 1 commit
    • Julia Lawall's avatar
      ALSA: sound/usb: Use negated usb_endpoint_xfer_control, etc · 913ae5a2
      Julia Lawall authored
      This patch extends 42a6e66f by using
      usb_endpoint_xfer_control, usb_endpoint_xfer_isoc, usb_endpoint_xfer_bulk,
      and usb_endpoint_xfer_int in the negated case as well.
      
      This patch also rewrites some calls to usb_endpoint_dir_in as negated calls
      to !usb_endpoint_dir_out, and vice versa, to better correspond to the
      intent of the original code.
      
      The semantic patch that makes this change is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @@ struct usb_endpoint_descriptor *epd; @@
      
      - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_CONTROL\|0\))
      + !usb_endpoint_xfer_control(epd)
      
      @@ struct usb_endpoint_descriptor *epd; @@
      
      - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_ISOC\|1\))
      + !usb_endpoint_xfer_isoc(epd)
      
      @@ struct usb_endpoint_descriptor *epd; @@
      
      - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_BULK\|2\))
      + !usb_endpoint_xfer_bulk(epd)
      
      @@ struct usb_endpoint_descriptor *epd; @@
      
      - (usb_endpoint_type(epd) != \(USB_ENDPOINT_XFER_INT\|3\))
      + !usb_endpoint_xfer_int(epd)
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      913ae5a2
  2. 02 Jan, 2009 1 commit
    • Julia Lawall's avatar
      ALSA: Use usb_set/get_intfdata · f4e9749f
      Julia Lawall authored
      Use the USB functions usb_get_intfdata and usb_set_intfdata instead of
      dev_get_drvdata and dev_set_drvdata, respectively.
      
      The semantic patch that makes this change for the usb_get_intfdata case is
      as follows: (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @header@
      @@
      
      #include <linux/usb.h>
      
      @same depends on header@
      position p;
      @@
      
      usb_get_intfdata@p(...) { ... }
      
      @depends on header@
      position _p!=same.p;
      identifier _f;
      struct usb_interface*intf;
      @@
      
      _f@_p(...) { <+...
      - dev_get_drvdata(&intf->dev)
      + usb_get_intfdata(intf)
      ...+> }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      f4e9749f
  3. 01 Jan, 2009 1 commit
    • Julia Lawall's avatar
      ALSA: sound/usb: use USB API functions rather than constants · 42a6e66f
      Julia Lawall authored
      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: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      42a6e66f
  4. 31 Dec, 2008 37 commits