lkml.org 
[lkml]   [2011]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4/5] usb/gadget: don't deploy SS descriptors if SS is not enabled.
Date
From
On Wed, 13 Apr 2011 12:56:57 +0200, Sebastian Andrzej Siewior  
<bigeasy@linutronix.de> wrote:

> Sergei Shtylyov wrote:
>> Hello.
>
> Hello Sergei,
>
>> Cleaned-up example:
>> (in header)
>> #ifndef CONFIG_NET_FUNKINESS
>> static inline void init_funky_net (struct net_device *d) {}
>> #endif
>> (in the code itself)
>> dev = alloc_etherdev (sizeof(struct funky_private));
>> if (!dev)
>> return -ENODEV;
>> init_funky_net(dev);
>
> The problem here is that the code is included via
>
> #include "composite.c
>
> so we don't really use header files. The alternative would be to use the
> gadget_is_super_speed() function but that one takes a gadget as argument.
> Preferences?

#ifdef CONFIG_USB_GADGET_SUPERSPEED
void usb_create_ss_descriptors(struct usb_function *f)
{
/* ... */
}
#else
static inline void usb_create_ss_descriptors(struct usb_function *f) { }
#endif

Is usually preferred.

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


\
 
 \ /
  Last update: 2011-04-13 13:01    [W:0.033 / U:2.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site