On Wed, May 02, 2012 at 10:10:31AM +0200, Ola Lilja wrote:
On 04/30/2012 12:04 PM, Mark Brown wrote:
The code I'm referring to is this:
which is definitely compile time. It's not the factoring stuff out, it's the way it's been done. Library code like Tegra uses isn't a problem but this sort of arrangement does cause problems.
OK, the thought with this was to be able to activate/deactivate the individual codec-drivers since we have several separate codecs on our Ux500-platform (Note that in this patch-set there is not patches for the other two codec-drivers). Since we already knows at compile-time if any of these three codecs are present we did it this ways, being able to add them separately in menuconfig.
This really isn't the idiom mainline is looking for, you should be able to build a kernel which will boot on multiple boards. There's a reason why you don't see this sort of ifdef in other code...
How could we solve this? All three codec-drivers has dependancies to other stuff being activated in menuconfig.
Like I say, library style code like Tegra has is totally fine if there's stuff that can usefully be shared.