On Tue, 28 Jun 2011, Greg KH wrote: > On Tue, Jun 28, 2011 at 04:33:51PM +0300, Felipe Balbi wrote: > > From: Tatyana Brokhman <tlinder@xxxxxxxxxxxxxx> > > > > This field is used by the Gadget drivers to specify > > the maximum speed they support, meaning: the maximum > > speed they can provide descriptors for. > > > > The driver speed will be set in consideration of this > > value. > > diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c > > index 93b999e..0d7f0ae 100644 > > --- a/drivers/usb/gadget/audio.c > > +++ b/drivers/usb/gadget/audio.c > > @@ -165,6 +165,11 @@ static struct usb_composite_driver audio_driver = { > > .name = "g_audio", > > .dev = &device_desc, > > .strings = audio_strings, > > +#ifdef CONFIG_USB_GADGET_DUALSPEED > > + .max_speed = USB_SPEED_HIGH, > > +#else > > + .max_speed = USB_SPEED_FULL, > > +#endif /* CONFIG_USB_GADGET_DUALSPEED */ > > Really? > > Come on, this is a mess, we don't want #ifdefs in .c files for a reason, > and this is an example of that. This was discussed in a recent email exchange. Those #ifdefs are completely unnecessary: max_speed is supposed to be the maximum speed supported by the driver, regardless of what the hardware allows. In this example, the code should simply say: .max_speed = USB_SPEED_HIGH, The other drivers should be handled similarly. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html