Skip to contentSkip to conversation

of_match_table on non-DT builds

DISCUSSION Rob Herring 3 participants 3 messages Nov 9, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Grant,

With the of_match_table pointer only enabled with CONFIG_OF in struct device_driver, all drivers will have to have #ifdefs around their of_match_table if you want to build them for non-devicetree platforms. This is just the tip of the iceberg as all probe related OF calls have to be ifdef'ed. Is this the intention?

Rob

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 7 lines · Rob Herring

Grant,

With the of_match_table pointer only enabled with CONFIG_OF in struct device_driver, all drivers will have to have #ifdefs around their of_match_table if you want to build them for non-devicetree platforms. This is just the tip of the iceberg as all probe related OF calls have to be ifdef'ed. Is this the intention?

Not really, and I'm not entirely sure about the best way to handle this. I might handle the of_match_table pointer using a macro so that the #ifdefs can be dropped in each individual device driver definition, or I might ask Greg to drop the #ifdefs around of_match_table in struct device_driver, but I don't really want to increase the size of struct device_driver for non-devicetree users.

Regardless, device drivers will still need #ifdefs around the CONFIG_OF specific code in the probe routine; probably by breaking the CONFIG_OF specific stuff into a helper function so that the #ifdef isn't in the middle of a function.

g.

A message that is not in the archive (sent off-list or not yet received): AANLkTi=11Jok3eujFwvji8ON1urcdeebCkJZgNrF=em5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 9 lines · Grant Likely
Quoted 7 lines · Rob Herring

Grant,

With the of_match_table pointer only enabled with CONFIG_OF in struct device_driver, all drivers will have to have #ifdefs around their of_match_table if you want to build them for non-devicetree platforms. This is just the tip of the iceberg as all probe related OF calls have to be ifdef'ed. Is this the intention?

Quoted 6 lines

Not really, and I'm not entirely sure about the best way to handle this. I might handle the of_match_table pointer using a macro so that the #ifdefs can be dropped in each individual device driver definition, or I might ask Greg to drop the #ifdefs around of_match_table in struct device_driver, but I don't really want to increase the size of struct device_driver for non-devicetree users.

That's ok, it's not that big of a deal to drop the #ifdef, especially if it makes the .c files more "sane".

I'll work on merging the dma stuff in 'struct device' to a single pointer, to get the space back, so you should be fine.

thanks,

greg k-h