Fix Kconfig dependency problems wrt boolean menuconfigs
authorTrent Piepho <xyzzy@speakeasy.org>
Wed, 27 Jun 2007 21:09:54 +0000 (14:09 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 28 Jun 2007 18:34:53 +0000 (11:34 -0700)
If one has a dependency chain (tristate)FOO depends on (bool)BAR depends on
(tristate)BAZ, build problems will result.  If BAZ=m, then BAR can be set
y, which allows FOO=y.  It's possible to have FOO=y && BAZ=m, which
wouldn't be allowed if FOO depended directly on BAZ.  In effect, the bool
promotes the tristate from m to y.

This ends up causing a problem with several menuconfigs that look like:

menuconfig BAR
bool
depends on BAZ [tristate]
if BAR
config FOO
tristate
endif

The solution used here is to add the dependencies of BAR to the if
statement, so that items in the if block will gain a direct
non-bool-promoted dependency on BAZ.  This is how it would work if a menu
was used instead of an if block.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Jeff Garzik <jeff@garzik.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/atm/Kconfig
drivers/media/dvb/Kconfig
drivers/media/radio/Kconfig
drivers/media/video/Kconfig
drivers/net/pcmcia/Kconfig

index f5a47a48c3b4a18f7286e30c6a75507486da193a..5b4fab24155f98105473683ff9145b46e5d3ee22 100644 (file)
@@ -7,7 +7,7 @@ menuconfig ATM_DRIVERS
        depends on NETDEVICES && ATM
        default y
 
-if ATM_DRIVERS
+if ATM_DRIVERS && NETDEVICES && ATM
 
 config ATM_DUMMY
        tristate "Dummy ATM driver"
index efd2b746815820e06698a209881e1d53c35d4cc8..03ef88acd9b826bbafc60ccad5a12be6e0302ceb 100644 (file)
@@ -11,7 +11,7 @@ menuconfig DVB_CAPTURE_DRIVERS
        ---help---
          Say Y to select Digital TV adapters
 
-if DVB_CAPTURE_DRIVERS
+if DVB_CAPTURE_DRIVERS && DVB_CORE
 
 comment "Supported SAA7146 based PCI Adapters"
        depends on DVB_CORE && PCI && I2C
index a6ac82a609d40c12315b9d60d9ef3a156fbafdd0..194b102140ef5f03501631f803cf54f2b614299b 100644 (file)
@@ -9,7 +9,7 @@ menuconfig RADIO_ADAPTERS
        ---help---
          Say Y here to enable selecting AM/FM radio adapters.
 
-if RADIO_ADAPTERS
+if RADIO_ADAPTERS && VIDEO_DEV
 
 config RADIO_CADET
        tristate "ADS Cadet AM/FM Tuner"
index 4cca55170e21f78f9425fff3d829cffe8d575bb1..4d45a40016deec706dda8d011653aa27c73193d7 100644 (file)
@@ -11,7 +11,7 @@ menuconfig VIDEO_CAPTURE_DRIVERS
          webcams, analog TV, and hybrid analog/digital TV.
          Some of those devices also supports FM radio.
 
-if VIDEO_CAPTURE_DRIVERS
+if VIDEO_CAPTURE_DRIVERS && VIDEO_DEV
 
 config VIDEO_ADV_DEBUG
        bool "Enable advanced debug functionality"
@@ -347,7 +347,7 @@ endmenu # encoder / decoder chips
 
 config VIDEO_VIVI
        tristate "Virtual Video Driver"
-       depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI && VIDEO_DEV
+       depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 && PCI
        select VIDEO_BUF
        default n
        ---help---
@@ -691,7 +691,7 @@ menuconfig V4L_USB_DRIVERS
        depends on USB
        default y
 
-if V4L_USB_DRIVERS
+if V4L_USB_DRIVERS && USB
 
 source "drivers/media/video/pvrusb2/Kconfig"
 
index 5d658bc9791ce147ab5bf2c8f8235bb1164c0640..e8f55d8ed7a900f86329e72e682c1f0f3023b02c 100644 (file)
@@ -19,7 +19,7 @@ menuconfig NET_PCMCIA
 
          If unsure, say N.
 
-if NET_PCMCIA
+if NET_PCMCIA && PCMCIA
 
 config PCMCIA_3C589
        tristate "3Com 3c589 PCMCIA support"