lkml.org 
[lkml]   [2011]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCHv3 4/4] usb: gadget: get rid of USB_GADGET_{DUAL,SUPER}SPEED
    On Sat, 20 Aug 2011, Michal Nazarewicz wrote:

    > From: Michal Nazarewicz <mina86@mina86.com>
    >
    > This commit removes USB_GADGET_DUALSPEED and USB_GADGET_SUPERSPEED
    > Kconfig options. Since now kernel allows many UDC drivers to be
    > compiled, those options may turn to no longer be valid. For
    > instance, if someone decides to build UDC that supports super
    > speed and UDC that supports high speed only, the latter will be
    > "assumed" to support super speed since USB_GADGET_SUPERSPEED will
    > be selected by the former.
    >
    > The test of whether CONFIG_USB_GADGET_*SPEED was defined was just
    > an optimisation which removed otherwise dead code (ie. if UDC is
    > not dual speed, there is no need to handle cases that can happen
    > if speed is high). This commit removes those checks.
    >
    > Signed-off-by: Michal Nazarewicz <mina86@mina86.com>

    ...

    > --- a/drivers/usb/gadget/dummy_hcd.c
    > +++ b/drivers/usb/gadget/dummy_hcd.c
    > @@ -985,7 +985,7 @@ static int dummy_udc_probe (struct platform_device *pdev)
    >
    > dum->gadget.name = gadget_name;
    > dum->gadget.ops = &dummy_ops;
    > - dum->gadget.max_speed = USB_SPEED_SUPER;;
    > + dum->gadget.max_speed = USB_SPEED_SUPER;

    You might as well get this right in patch 2/4. Then this hunk
    wouldn't be needed.


    > --- a/drivers/usb/gadget/inode.c
    > +++ b/drivers/usb/gadget/inode.c
    ...
    > @@ -1773,11 +1767,7 @@ gadgetfs_suspend (struct usb_gadget *gadget)
    > }
    >
    > static struct usb_gadget_driver gadgetfs_driver = {
    > -#ifdef CONFIG_USB_GADGET_DUALSPEED
    > .max_speed = USB_SPEED_HIGH,
    > -#else
    > - .max_speed = USB_SPEED_FULL,
    > -#endif

    I'm not sure that a static definition is correct here. The actual
    max_speed depends on what descriptors the userspace program sends.
    Take a look at the ep_config() routine.

    Alan Stern



    \
     
     \ /
      Last update: 2011-08-20 15:43    [W:0.020 / U:30.992 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site