Skip to contentSkip to conversation

Kconfig with multiple sources of integer value

DISCUSSION Ben Dooks 2 participants 2 messages Jan 11, 2010 – Jan 18, 2010 Kbuild

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

I have a situation (and possibly some more) where having the ability for multiple options to affect an integer value, in this case ensuring a minimum value.

currently we have the following:

config S3C24XX_GPIO_EXTRA

        int
        default 128 if S3C24XX_GPIO_EXTRA128
        default 64 if S3C24XX_GPIO_EXTRA64
        default 0

and various machines select S3C24XX_GPIO_EXTRA64 or S3C24XX_GPIO_EXTR128 such as:

config MACH_OSIRIS

       ...
        select S3C24XX_GPIO_EXTRA128

It would be nice if I could say

config S3C24XX_GPIO_EXTRA

and then

config MACH_OSIRIS

       ...
       set_min S3C24XX_GPIO_EXTRA 128

or something similar.

Signature · 4 lines
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#1 lore raw
Quoted 11 lines · Ben Dooks

It would be nice if I could say

config S3C24XX_GPIO_EXTRA

and then

config MACH_OSIRIS

       ...
       set_min S3C24XX_GPIO_EXTRA 128

or something similar.

Or maybe extend 'select' to accept
select FOO=<value>
and allow select for integer options too (in which case, the =<value> would be mandatory). Then it would look like

config MACH_OSIRIS

       ...
       select S3C24XX_GPIO_EXTRA=128

What do you think?

Michal