From david-b@pacbell.net Fri May  6 07:26:43 2005
From: David Brownell <david-b@pacbell.net>
To: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Subject: USB: Kconfig fixes for usb/gadget
Date: Fri, 6 May 2005 07:02:01 -0700
Cc: Greg KH <gregkh@suse.de>, Al Viro <viro@www.linux.org.uk>,
	torvalds@osdl.org
Message-Id: <200505060702.01557.david-b@pacbell.net>


This prevents gadget drivers from being selected when no controller has
been selected, by adding an additional boolean and depending on it.
It's mostly to help "allmodconfig".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/gadget/Kconfig |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

--- gregkh-2.6.orig/drivers/usb/gadget/Kconfig	2005-04-06 11:47:47.000000000 -0700
+++ gregkh-2.6/drivers/usb/gadget/Kconfig	2005-05-06 12:14:33.000000000 -0700
@@ -53,6 +53,9 @@
 	   driver on a new board.   Enable these files by choosing "Y"
 	   here.  If in doubt, or to conserve kernel memory, say "N".
 
+config	USB_GADGET_SELECTED
+	boolean
+
 #
 # USB Peripheral Controller Support
 #
@@ -85,6 +88,7 @@
 	tristate
 	depends on USB_GADGET_NET2280
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 config USB_GADGET_PXA2XX
 	boolean "PXA 25x or IXP 4xx"
@@ -105,6 +109,7 @@
 	tristate
 	depends on USB_GADGET_PXA2XX
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 # if there's only one gadget driver, using only two bulk endpoints,
 # don't waste memory for the other endpoints
@@ -134,6 +139,7 @@
 	tristate
 	depends on USB_GADGET_GOKU
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 
 config USB_GADGET_LH7A40X
@@ -146,6 +152,7 @@
 	tristate
 	depends on USB_GADGET_LH7A40X
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 
 config USB_GADGET_OMAP
@@ -167,6 +174,7 @@
 	tristate
 	depends on USB_GADGET_OMAP
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 config USB_OTG
 	boolean "OTG Support"
@@ -207,6 +215,7 @@
 	tristate
 	depends on USB_GADGET_DUMMY_HCD
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 # NOTE:  Please keep dummy_hcd LAST so that "real hardware" appears
 # first and will be selected by default.
@@ -226,7 +235,7 @@
 #
 choice
 	tristate "USB Gadget Drivers"
-	depends on USB_GADGET
+	depends on USB_GADGET && USB_GADGET_SELECTED
 	default USB_ETH
 	help
 	  A Linux "Gadget Driver" talks to the USB Peripheral Controller