Hi, > On Fri, May 21, 2010 at 07:15:37AM +0200, ext Gupta, Ajay Kumar wrote: > >Hi, > >> > +#ifdef CONFIG_USB_MUSB_OTG > >> > + .mode > >> > = MUSB_OTG, > >> > +#elif defined(CONFIG_USB_MUSB_HDRC_HCD) > >> > + .mode > >> > = MUSB_HOST, > >> > +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC) > >> > .mode > >> > = MUSB_PERIPHERAL, > >> > +#endif > >> > >> > = MUSB_PERIPHERAL, > >> > +#endif > >> > >> By the way ... the #ifdeffery should indeed vanish from all board > >> configs except the Davinci DM6446 EVM. > > > >If we are claiming to support: > > A. Same kernel would work on multiple boards > > B. Single kernel for one single board > > > >Then I think these #ifdefferys are required in all the board files. > > > >Let's consider the OMAP3EVM which supports all the three modes and > > you don't support "all three modes" you support OTG. If you want to > build for peripheral only, that's your choice, but the board is wired so > that it has OTG support. I meant OTG with ID pin based role. > > >If these #ifdefferys are not present and .mode is set to OTG. > >Then if I choose to compile the Kernel only for peripheral mode > >(Case-B above) then I would get below error from musb_core.c. > > > >"incompatible Kconfig role setting" > > there's a patch making that a warning instead of an #error if I'm not > wrong. If that patch ([1] below) is taken then we can avoid all these #ifdefs. [1] http://marc.info/?l=linux-usb&m=127367875600618&w=2 But I see comment from David on above patch [1] to fix board data Instead which means using #ifdefs again in board files... With all these discussion it's best to accept the above [1] patch and Avoid having ugly #ifdefs from board files. -Ajay > > -- > balbi > > DefectiveByDesign.org -- 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