• David Brownell's avatar
    [PATCH] add usb_reset_configuration() · d6ecf7ed
    David Brownell authored
    Unfortunately, usb_set_configuration() is widely mis-used as a
    lightweight device reset.  That's trouble because setting a
    configuration must sometimes involve things that don't relate
    at all to a light reset, and can't be done in contexts like
    driver probe() calls.
    
    This patch updates most usb_set_configuration() users to use a call
    that provides more appropriate functionality:
    
      - Adds a new usb_reset_configuration() call, which never needs
        to change very much usbcore state.
    
      - Uses it to replace most usb_set_configuration() calls, in
        many serial drivers, hisax, dvb, irda, and so on.
    
      - Modifies usb_reset_device() so it issues the control request
        directly.  It's both more of a reset (hides a USB reset) and
        less of one (altsettings are unchanged).
    
      - Makes usbfs return the error code instead of discarding it.
    
    Once this goes in, then usb_set_configuration() can be made to
    work properly (including from sysfs).
    d6ecf7ed
usbaudio.c 81.2 KB