Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How definitions in .config are related to src code #ifdef's
PostPosted: Tue Jan 24, 2012 6:52 pm 
Offline

Joined: Tue Dec 06, 2011 5:24 pm
Posts: 6
Hello,
I'm fixing the registration of 'at91_udc' with help of patch
https://lkml.org/lkml/2011/11/30/44
but with no effect.
It seem like < #ifdef CONFIG_USB_AT91 > in at91sam9260_devices.c has no relation to < CONFIG_USB_AT91=m > in my kernel .config and so patch does not work. After manually defining CONFIG_USB_AT91 in at91sam9260_devices.c everithing is OK.

Can somebody clarify how to make #ifdef conditions (in source code) dependent on definitions in .config ??

board based on at91sam9260ek, linux-3.1.4, 3.1.0-at91.patch

Thanks
(my 1st post)

Karel


Top
 Profile  
 
 Post subject: Re: How definitions in .config are related to src code #ifde
PostPosted: Wed Jan 25, 2012 3:31 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
The identifiers in the .config file should be usable in preprocessor conditionals. Something else may be going on; perhaps CONFIG_USB_AT91 is being #undefined somewhere? Try a 'grep' on your source tree for all occurrences of that identifier or just "USB_AT91" to catch Kconfig references.

Maybe you should look in the history for that patch. Seems like that there have been two identifiers for AT91 USB gadgets, CONFIG_USB_AT91 and CONFIG_USB_GADGET_AT91, but now is there some kind of consolidation or elimination of a redundant identifier?

What happens if you set CONFIG_USB_AT91 to "y" instead of making it a module?

Regards


Top
 Profile  
 
 Post subject: Re: How definitions in .config are related to src code #ifde
PostPosted: Wed Jan 25, 2012 2:39 pm 
Offline

Joined: Tue Dec 06, 2011 5:24 pm
Posts: 6
It is #defined only in include/generated/autoconf.h

blue_z wrote:
What happens if you set CONFIG_USB_AT91 to "y" instead of making it a module?
Regards


CONFIG_USB_AT91=y => #define CONFIG_USB_AT91
CONFIG_USB_AT91=m => #define CONFIG_USB_AT91_MODULE

So the better way how to make such patch is something like

-#ifdef CONFIG_USB_GADGET_AT91
+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)


Top
 Profile  
 
 Post subject: Re: How definitions in .config are related to src code #ifde
PostPosted: Thu Jan 26, 2012 2:02 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 204
Location: USA
You should communicate your findings to the patch author.

Regards


Top
 Profile  
 
 Post subject: Re: How definitions in .config are related to src code #ifde
PostPosted: Thu Jan 26, 2012 2:43 pm 
Offline

Joined: Tue Dec 06, 2011 5:24 pm
Posts: 6
blue_z wrote:
You should communicate your findings to the patch author.

Regards

done


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: