Sebastian Andrzej Siewior <bige...@linutronix.de> writes:
> On 08/24/2012 11:34 PM, Michal Nazarewicz wrote:
>>> diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c
>>> index 689d142..a9c687a 100644
>>> --- a/drivers/usb/gadget/audio.c
>>> +++ b/drivers/usb/gadget/audio.c
>>> @@ -13,6 +13,7 @@
>>>
>>>   #include<linux/kernel.h>
>>>   #include<linux/utsname.h>
>>> +#include<linux/usb/composite.h>
>>
>> Why is this needed in this patch?  I think it belongs to one of the
>> later patches.
>
> The USB_GADGET_COMPOSITE_OPTIONS() is defined there and nobody probably
> included this. However we still should have composite.c... I could
> recheck if you want.

I feel that since the file includes composite.c, there should be no need
to include composite.h, and this include should be added in the patch
that removes inclusion of composite.c.  I don't really have strong
feelings though.

>>> @@ -1263,7 +1264,13 @@ static int printer_unbind(struct usb_composite_dev 
>>> *cdev)
>>>
>>>   static int __init printer_bind(struct usb_composite_dev *cdev)
>>>   {
>>> -   return usb_add_config(cdev,&printer_cfg_driver, printer_bind_config);
>>> +   int ret;
>>> +
>>> +   ret = usb_add_config(cdev,&printer_cfg_driver, printer_bind_config);
>>> +   if (ret)
>>> +           return ret;
>>> +   USB_GADGET_COMPOSITE_OVERWRITE_OPTIONS(device_desc);
>>> +   return 0;
>>
>> Alternatively you could just add invocation of the
>> USB_GADGET_COMPOSITE_OVERWRITE_OPTIONS(device_desc) macro before the
>> usb_add_config() is added, which would add only one additional line,
>> like so:
>>
>>   {
>> +    USB_GADGET_COMPOSITE_OVERWRITE_OPTIONS(device_desc);
>>      return usb_add_config(cdev,&printer_cfg_driver, printer_bind_config);
>>   }
>
> I added it always more or less as the last the thing in the bind
> function because this reflects the same behavior before I pushed it
> from composite down to the gadget driver.
>
> I add later iSerialNumber and so on. Do you want these was well to be
> moved before this usb_add_config()?

No, that's fine, I was just wondering if there is a reason to use a more
complicated approach, and if there is, feel free to stick with it. :)

Acked-by: Michal Nazarewicz <min...@mina86.com>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: m...@google.com>--------------ooO--(_)--Ooo--

Attachment: pgpLwXlv4CEeD.pgp
Description: PGP signature

Reply via email to