History

usb: get rid of 'choice' for legacy gadget drivers

drivers/usb/gadget/legacy/Kconfig creates a 'choice' inside another 'choice'. The outer choice: line 17 "USB Gadget precomposed configurations" The inner choice: line 484 "EHCI Debug Device mode" I wondered why the whole legacy gadget drivers reside in such a big choice block. This dates back to 2003, "[PATCH] USB: fix for multiple definition of `usb_gadget_get_string'". [1] At that time, the global function, usb_gadget_get_string(), was linked into multiple drivers. That was why only one driver was able to become built-in at the same time. Later, commit a84d9e5361bc ("usb: gadget: start with libcomposite") moved usb_gadget_get_string() to a separate module, libcomposite.ko instead of including usbstring.c from multiple modules. More and more refactoring was done, and after commit 1bcce939478f ("usb: gadget: multi: convert to new interface of f_mass_storage"), you can link multiple gadget drivers into vmlinux without causing multiple definition error. This is the only user of the nested choice structure ever. Removing this mess will make some Kconfig cleanups possible. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=fee4cf49a81381e072c063571d1aadbb29207408

Masahiro Yamada committed 6 years ago

Commit df8df5e1 parent 0339f7f1 file · +22 −26Browse files

Unified · Split

drivers/usb/gadget/legacy/Kconfig+22−26
@@ -13,32 +13,28 @@ · 12 unmodified lines
1313 # With help from a special transceiver and a "Mini-AB" jack, systems with
1414 # both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
1515 #
16+# A Linux "Gadget Driver" talks to the USB Peripheral Controller
17+# driver through the abstract "gadget" API. Some other operating
18+# systems call these "client" drivers, of which "class drivers"
19+# are a subset (implementing a USB device class specification).
20+# A gadget driver implements one or more USB functions using
21+# the peripheral hardware.
22+#
23+# Gadget drivers are hardware-neutral, or "platform independent",
24+# except that they sometimes must understand quirks or limitations
25+# of the particular controllers they work with. For example, when
26+# a controller doesn't support alternate configurations or provide
27+# enough of the right types of endpoints, the gadget driver might
28+# not be able work with that controller, or might need to implement
29+# a less common variant of a device class protocol.
30+#
31+# The available choices each represent a single precomposed USB
32+# gadget configuration. In the device model, each option contains
33+# both the device instantiation as a child for a USB gadget
34+# controller, and the relevant drivers for each function declared
35+# by the device.
1636
17−choice
18− tristate "USB Gadget precomposed configurations"
19− default USB_ETH
20− optional
21− help
22− A Linux "Gadget Driver" talks to the USB Peripheral Controller
23− driver through the abstract "gadget" API. Some other operating
24− systems call these "client" drivers, of which "class drivers"
25− are a subset (implementing a USB device class specification).
26− A gadget driver implements one or more USB functions using
27− the peripheral hardware.
28−
29− Gadget drivers are hardware-neutral, or "platform independent",
30− except that they sometimes must understand quirks or limitations
31− of the particular controllers they work with. For example, when
32− a controller doesn't support alternate configurations or provide
33− enough of the right types of endpoints, the gadget driver might
34− not be able work with that controller, or might need to implement
35− a less common variant of a device class protocol.
36−
37− The available choices each represent a single precomposed USB
38− gadget configuration. In the device model, each option contains
39− both the device instantiation as a child for a USB gadget
40− controller, and the relevant drivers for each function declared
41− by the device.
37+menu "USB Gadget precomposed configurations"
4238
4339 config USB_ZERO
4440 tristate "Gadget Zero (DEVELOPMENT)"
@@ -527,4 +523,4 @@ config USB_RAW_GADGET · 482 unmodified lines
527523 Say "y" to link the driver statically, or "m" to build a
528524 dynamically linked module called "raw_gadget".
529525
530−endchoice
526+endmenu

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t