Skip to contentSkip to conversation

USB_GADGET depends on USB

PATCH In review Jakub Bogusz 2 participants 4 messages Mar 3, 2004 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB_GADGET depends on USB

Up to current cset it's possible to select USB_GADGET even if USB is disabled (causing only compilation errors). This patch adds depends rules to disallow USB_GADGET if USB is not enabled (similar to those found in other drivers/usb/*/Kconfig files).

Signature · 2 lines
Jakub Bogusz    http://cyber.cs.net.pl/~qboosh/
PLD Team        http://www.pld-linux.org/
drivers/usb/gadget/Kconfig renamed from drivers/usb/gadget/Kconfig.orig +2 -0
@@ -4,9 +4,11 @@
 #    (b) the gadget driver using it.
 #
 menu "USB Gadget Support"
+	depends on USB
 
 config USB_GADGET
 	tristate "Support for USB Gadgets"
+	depends on USB
 	help
 	   USB is a master/slave protocol, organized with one master
 	   host (such as a PC) controlling up to 127 peripheral devices.
#1 lore raw
Quoted 4 lines · Jakub Bogusz

Up to current cset it's possible to select USB_GADGET even if USB is disabled (causing only compilation errors). This patch adds depends rules to disallow USB_GADGET if USB is not enabled (similar to those found in other drivers/usb/*/Kconfig files).

But why would you want to do that? You can have a box with USB gadget support but not USB "host" support on it just fine.

This patch is not correct, nor needed.

thanks,

greg k-h

#2 lore raw
Quoted 10 lines · Greg KH
Quoted 4 lines · Jakub Bogusz

Up to current cset it's possible to select USB_GADGET even if USB is disabled (causing only compilation errors). This patch adds depends rules to disallow USB_GADGET if USB is not enabled (similar to those found in other drivers/usb/*/Kconfig files).

But why would you want to do that? You can have a box with USB gadget support but not USB "host" support on it just fine.

This patch is not correct, nor needed.

Now I know, David Brownell already explained it to me.

It was because make (old)config) asks questions about USB_GADGET, USB_ETH, USB_FILE_STORAGE, USB_G_SERIAL, USB_ZERO, USB_GADGETFS even on platforms where no USB peripheral controller is available (like sparc32) - which make no sense as none of them can be built without any CONFIG_USB_GADGET_*.
These options could be omitted on such platforms...

Signature · 2 lines
Jakub Bogusz    http://cyber.cs.net.pl/~qboosh/
PLD Team        http://www.pld-linux.org/
#3 lore raw
Quoted 12 lines · Jakub Bogusz
Quoted 10 lines · Greg KH
Quoted 4 lines · Jakub Bogusz

Up to current cset it's possible to select USB_GADGET even if USB is disabled (causing only compilation errors). This patch adds depends rules to disallow USB_GADGET if USB is not enabled (similar to those found in other drivers/usb/*/Kconfig files).

But why would you want to do that? You can have a box with USB gadget support but not USB "host" support on it just fine.

This patch is not correct, nor needed.

Quoted 8 lines

Now I know, David Brownell already explained it to me.

It was because make (old)config) asks questions about USB_GADGET, USB_ETH, USB_FILE_STORAGE, USB_G_SERIAL, USB_ZERO, USB_GADGETFS even on platforms where no USB peripheral controller is available (like sparc32) - which make no sense as none of them can be built without any CONFIG_USB_GADGET_*.
These options could be omitted on such platforms...

Hm, does the following patch help this any? I don't see that it should, but who knows...

thanks,

greg k-h

# USB Gadget: clean up the Kconfig dependancies a bit more.

drivers/usb/gadget/Kconfig +9 -8
diff -Nru a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
@@ -42,7 +42,7 @@
 
 config USB_GADGET_NET2280
 	boolean "NetChip 2280"
-	depends on PCI
+	depends on USB_GADGET && PCI
 	help
 	   NetChip 2280 is a PCI based USB peripheral controller which
 	   supports both full and high speed USB 2.0 data transfers.  
@@ -62,7 +62,7 @@
 
 config USB_GADGET_PXA2XX
 	boolean "PXA 2xx or IXP 42x"
-	depends on ARCH_PXA || ARCH_IXP425
+	depends on USB_GADGET && (ARCH_PXA || ARCH_IXP425)
 	help
 	   Intel's PXA 2xx series XScale ARM-5TE processors include
 	   an integrated full speed USB 1.1 device controller.  The
@@ -91,7 +91,7 @@
 
 config USB_GADGET_GOKU
 	boolean "Toshiba TC86C001 'Goku-S'"
-	depends on PCI
+	depends on USB_GADGET && PCI
 	help
 	   The Toshiba TC86C001 is a PCI device which includes controllers
 	   for full speed USB devices, IDE, I2C, SIO, plus a USB host (OHCI).
@@ -111,7 +111,7 @@
 # this could be built elsewhere (doesn't yet exist)
 config USB_GADGET_SA1100
 	boolean "SA 1100"
-	depends on ARCH_SA1100
+	depends on USB_GADGET && ARCH_SA1100
 	help
 	   Intel's SA-1100 is an ARM-4 processor with an integrated
 	   full speed USB 1.1 device controller.
@@ -139,7 +139,7 @@
 
 config USB_ZERO
 	tristate "Gadget Zero (DEVELOPMENT)"
-	depends on EXPERIMENTAL
+	depends on USB_GADGET && EXPERIMENTAL
 	help
 	  Gadget Zero is a two-configuration device.  It either sinks and
 	  sources bulk data; or it loops back a configurable number of
@@ -164,7 +164,7 @@
 
 config USB_ETH
 	tristate "Ethernet Gadget"
-	depends on NET
+	depends on USB_GADGET && NET
 	help
 	  This driver implements Ethernet style communication, in either
 	  of two ways:
@@ -192,7 +192,7 @@
 
 config USB_GADGETFS
 	tristate "Gadget Filesystem (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	depends on USB_GADGET && EXPERIMENTAL
 	help
 	  This driver provides a filesystem based API that lets user mode
 	  programs implement a single-configuration USB device, including
@@ -206,7 +206,7 @@
 config USB_FILE_STORAGE
 	tristate "File-backed Storage Gadget (DEVELOPMENT)"
 	# we don't support the SA1100 because of its limitations
-	depends on USB_GADGET_SA1100 = n
+	depends on USB_GADGET && USB_GADGET_SA1100 = n
 	help
 	  The File-backed Storage Gadget acts as a USB Mass Storage
 	  disk drive.  As its storage repository it can use a regular
@@ -228,6 +228,7 @@
 
 config USB_G_SERIAL
 	tristate "Serial Gadget"
+	depends on USB_GADGET
 	help
 	  The Serial Gadget talks to the Linux-USB generic serial driver.