lkml.org 
[lkml]   [2011]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] usb: gadget: get rid of USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED
    On Wed, 17 Aug 2011, Michal Nazarewicz wrote:

    > > On Wed, 17 Aug 2011, Michal Nazarewicz wrote:
    > >> @@ -1609,8 +1603,7 @@ int usb_composite_probe(struct
    > >> usb_composite_driver *driver,
    > >> driver->iProduct = driver->name;
    > >> composite_driver.function = (char *) driver->name;
    > >> composite_driver.driver.name = driver->name;
    > >> - composite_driver.speed = min((u8)composite_driver.speed,
    > >> - (u8)driver->max_speed);
    > >> + composite_driver.speed = min(USB_SPEED_SUPER, driver->max_speed);
    >
    > On Wed, 17 Aug 2011 16:20:15 +0200, Alan Stern <stern@rowland.harvard.edu>
    > wrote:
    > > I wonder if the min is needed here at all. It doesn't seem to be doing
    > > any good.
    >
    > Do you mean just doing “composite_driver.speed = driver->max_speed”?

    Yes. After all, there aren't any usb_device_speed values larger than
    USB_SPEED_SUPER.


    > >> --- a/drivers/usb/gadget/file_storage.c
    > >> +++ b/drivers/usb/gadget/file_storage.c
    > >> @@ -3562,11 +3562,7 @@ static void fsg_resume(struct usb_gadget *gadget)
    > >> /*-------------------------------------------------------------------------*/
    > >>
    > >> static struct usb_gadget_driver fsg_driver = {
    > >> -#ifdef CONFIG_USB_GADGET_DUALSPEED
    > >> .speed = USB_SPEED_HIGH,
    > >> -#else
    > >> - .speed = USB_SPEED_FULL,
    > >> -#endif
    > >> .function = (char *) fsg_string_product,
    > >> .unbind = fsg_unbind,
    > >> .disconnect = fsg_disconnect,
    >
    > > You mustn't remove the .speed field entirely. Set it to USB_SPEED_HIGH.
    > > The same goes for the other drivers below.
    >
    > Please note that the field is not in fact removed.

    No, but you removed its initializer and as a result, it will be set to
    0 whereas it should be set to USB_SPEED_HIGH.

    Alan Stern

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2011-08-17 16:49    [W:0.036 / U:90.784 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site