Skip to contentSkip to conversation

let USB_GADGET depend on USB

PATCH In review Adrian Bunk 3 participants 6 messages May 31, 2003 – Jun 1, 2003 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 let USB_GADGET depend on USB

USB_GADGET is still selectable even with USB disabled. It seems the following is intended:

drivers/usb/gadget/Kconfig renamed from drivers/usb/gadget/Kconfig.old +1 -1
@@ -8,7 +8,7 @@
 #
 menuconfig USB_GADGET
 	tristate "Support for USB Gadgets"
-	depends on EXPERIMENTAL
+	depends on USB && EXPERIMENTAL
 	help
 	   USB is a master/slave protocol, organized with one master
 	   host (such as a PC) controlling up to 127 peripheral devices.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#1 lore raw
Quoted 1 line · Adrian Bunk

USB_GADGET is still selectable even with USB disabled. It seems the following is intended:

This is wrong.

CONFIG_USB has always represented the master/host side ... while CONFIG_USB_GADGET represents just the slave/gadget side.

The two are completely independent. Hardware that supports one will typically _not_ support the other. And systems that support the slave/gadget side will have no use at all for the 100KB+ of "usbcore".

If you want CONFIG_USB_GADGET to depend on USB, then you're going to need to change the meaning of CONFIG_USB so that it becomes just an "umbrella" ... and change EVERYTHING that currently depends on CONFIG_USB to depend on some new config varaible representing just the host side (which also depends on CONFIG_USB). That sort of change seems pointless.

Quoted 17 lines
drivers/usb/gadget/Kconfig renamed from drivers/usb/gadget/Kconfig.old +1 -1
@@ -8,7 +8,7 @@
 #
 menuconfig USB_GADGET
 	tristate "Support for USB Gadgets"
-	depends on EXPERIMENTAL
+	depends on USB && EXPERIMENTAL
 	help
 	   USB is a master/slave protocol, organized with one master
 	   host (such as a PC) controlling up to 127 peripheral devices.

cu
Adrian

#2 lore raw
Quoted 6 lines · David Brownell
Quoted 2 lines · Adrian Bunk

USB_GADGET is still selectable even with USB disabled. It seems the following is intended:

This is wrong.

Quoted 8 lines

CONFIG_USB has always represented the master/host side ... while CONFIG_USB_GADGET represents just the slave/gadget side.

The two are completely independent. Hardware that supports one will typically _not_ support the other. And systems that support the slave/gadget side will have no use at all for the 100KB+ of "usbcore".
...

Well, CONFIG_USB_GADGET without CONFIG_USB gives me the following link error in 2.5.70-mm3:

<-- snip -->

...
LD .tmp_vmlinux1
security/built-in.o(.text+0x246d): In function `find_usb_device':
: undefined reference to usb_bus_list_lock' security/built-in.o(.text+0x2481): In function find_usb_device':
: undefined reference to usb_bus_list_lock' security/built-in.o(.text+0x248d): In function find_usb_device':
: undefined reference to usb_bus_list' security/built-in.o(.text+0x2493): In function find_usb_device':
: undefined reference to usb_bus_list' security/built-in.o(.text+0x24b3): In function find_usb_device':
: undefined reference to usb_bus_list' security/built-in.o(.text+0x24ba): In function find_usb_device':
: undefined reference to usb_bus_list_lock' security/built-in.o(.text+0x24c0): In function find_usb_device':
: undefined reference to `usb_bus_list_lock'
make: *** [.tmp_vmlinux1] Error 1

<-- snip -->

If you disagree with my patch please fix the compilation of CONFIG_USB_GADGET without CONFIG_USB.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 11 lines · Adrian Bunk
Quoted 9 lines · David Brownell
Quoted 1 line · Adrian Bunk

USB_GADGET is still selectable even with USB disabled. It seems the following is intended:

This is wrong.

CONFIG_USB has always represented the master/host side ... while CONFIG_USB_GADGET represents just the slave/gadget side.

Quoted 8 lines
Quoted 5 lines

The two are completely independent. Hardware that supports one will typically _not_ support the other. And systems that support [only] the slave/gadget side will have no use at all for the 100KB+ of "usbcore".
...

Well, CONFIG_USB_GADGET without CONFIG_USB gives me the following link error in 2.5.70-mm3:

As I had already said (in response to your email that reported that problem), the fix is to revert the recent changeset that links gadget code twice. Here's a patch that undoes it.

- Dave

drivers/usb/Makefile +0 -3
@@ -59,6 +59,3 @@
 obj-$(CONFIG_USB_TIGL)		+= misc/
 obj-$(CONFIG_USB_USS720)	+= misc/
 
-obj-$(CONFIG_USB_NET2280)	+= gadget/
-obj-$(CONFIG_USB_ZERO)		+= gadget/
-obj-$(CONFIG_USB_ETH)		+= gadget/
#4 lore raw
Quoted 4 lines · David Brownell

As I had already said (in response to your email that reported that problem), the fix is to revert the recent changeset that links gadget code twice. Here's a patch that undoes it.

Yeah, that was my fault, sorry. I didn't see the main Makefile change and thought that this had gotten lost in one of my merges. I'll revert it and send it off to Linus later on.

Sorry,

greg k-h

#5 lore raw
In reply to David Brownell
Quoted 4 lines · David Brownell

As I had already said (in response to your email that reported that problem), the fix is to revert the recent changeset that links gadget code twice. Here's a patch that undoes it.

Ups, sorry, I confused this with a different issue.

drivers/usb/Makefile line 64

Quoted 12 lines

- Dave

drivers/usb/Makefile +0 -3
@@ -59,6 +59,3 @@
 obj-$(CONFIG_USB_TIGL)		+= misc/
 obj-$(CONFIG_USB_USS720)	+= misc/
 
-obj-$(CONFIG_USB_NET2280)	+= gadget/
-obj-$(CONFIG_USB_ZERO)		+= gadget/
-obj-$(CONFIG_USB_ETH)		+= gadget/

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed