Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752679AbdLKLbI (ORCPT ); Mon, 11 Dec 2017 06:31:08 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:62793 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbdLKLbE (ORCPT ); Mon, 11 Dec 2017 06:31:04 -0500 From: Arnd Bergmann To: Felipe Balbi , Greg Kroah-Hartman Cc: linux-media@vger.kernel.org, Arnd Bergmann , Ruslan Bilovol , Romain Izard , Mauro Carvalho Chehab , Hannes Reinecke , Thadeu Lima de Souza Cascardo , Bart Van Assche , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] usb: gadget: restore tristate-choice for legacy gadgets Date: Mon, 11 Dec 2017 12:30:13 +0100 Message-Id: <20171211113048.3514863-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:zznJTVgl7Y8Y7CFE7asJ/yN1feWUp3KoaJens91cnMbkChUdK3Q EHImDuwQgBRHZWWL1Xq2b+Ls3BSxzCLASRcce9W4gJWO6HdeIuvFUlXJTb4tbpTVugfUzAf Y3Mp6VnlEbTLqvXEY2ddupzCvBBKl35v7x+vDMOxlfHe8IZ+1IcG2uLwN8Rw+wIynpld2rX P2Jb7EI8Oa+JDySOEjspA== X-UI-Out-Filterresults: notjunk:1;V01:K0:hJphVZZ7AOM=:ZFE6CvY8uD9TmfhTSsMPAj P6Sd5fSBSUBXhk7bC++bSTLaJcaac8MPmp8WXFSVNm7TkUTQH0Nofg3jFZMvsq7lrRhKMDXFq 2SG4UnFUpHjbWpV1FfTq5PU7kYyXKJ9PQT8yHaUkBbefd9ZwGkLQo/fDtyrsiJMBqYopMVbiF KsGfUJZbRt7k38i2RD3IUHPaz37oYaLCS7PbhjMiWepsmiwLtVxySct2PgnYDDhj0JtTxs2AN OF4YYBCeGJxzc41Tt9lBiVhjdT5pLoE4fsHLyN7ca8VLKH41rgqVGIZ9i0R1cotcbSdNQcpBl 4rFFg+IZ9LdUs+EkHWXoPpZM6fVWfz0Imbcu4VGjQvt5t09M670ifa15Gs3Il50NeDTh4EpNm hjyVbenRH57m2T6cFD7PTvYZfhU58a9rK1di7aQJNfSeVVdHWLGIqbS4Q11hh5MztUE+wvR8L MtrL10DKla0QZM1QVpWYy0dJEs7U8dmwtf9YIZs4FrKNsNDj6alaCW4j9CWcQwnf0N8RjpwLu vQLELIpEhZltJGQy1/U3sJOP+TQBaSbMxBEYmHy0yzlegA1Qa5c958/t/1TamLAuM+Umf4yxe a72QkmY8zAeNM3ecLJnbPVyNm3x1GSFPueFInHDkTA/c4iA56K47ZpTp3Dqq76X8ybTsKXQzo 9lNxzNjujuqa6ElhLitpfXjWvY/BNq5njvhQCfBR+4d7ZRpmaCT0ZY4nBOQLaQyH5L1CzmXpV lVRTjQBZbf9o5UOQjDzTEaKE7ma3gnRQ6N8g4Q== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4800 Lines: 113 One patch that was meant as a cleanup apparently did more than it intended, allowing all combinations of legacy gadget drivers to be built into the kernel, and leaving an empty 'choice' statement behind: drivers/usb/gadget/Kconfig:487:warning: choice default symbol 'USB_ETH' is not contained in the choice The description of commit 7a9618a22aad ("usb: gadget: allow to enable legacy drivers without USB_ETH") was a bit cryptic, as it did not change the behavior of USB_ETH other than allowing it to be built into the kernel alongside other legacy gadgets, which is not a valid configuration. As Felipe explained in the description for commit bc49d1d17dcf ("usb: gadget: don't couple configfs to legacy gadgets"), the configfs based gadgets can be freely configured as loadable modules or built-in drivers, but the legacy gadgets can only be modules if there is more than one of them, so we require the 'choice' statement here. This leaves the added USB_GADGET_LEGACY menuconfig symbol in place, but then restores the 'choice' below it, so we can enforce the single-legacy-gadget rule as before. Fixes: 7a9618a22aad ("usb: gadget: allow to enable legacy drivers without USB_ETH") Signed-off-by: Arnd Bergmann --- drivers/usb/gadget/Kconfig | 28 ---------------------------- drivers/usb/gadget/legacy/Kconfig | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 0a19a76645ad..eab61f552c19 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -482,34 +482,6 @@ config USB_CONFIGFS_F_TCM Both protocols can work on USB2.0 and USB3.0. UAS utilizes the USB 3.0 feature called streams support. -choice - tristate "USB Gadget precomposed configurations" - default USB_ETH - optional - help - A Linux "Gadget Driver" talks to the USB Peripheral Controller - driver through the abstract "gadget" API. Some other operating - systems call these "client" drivers, of which "class drivers" - are a subset (implementing a USB device class specification). - A gadget driver implements one or more USB functions using - the peripheral hardware. - - Gadget drivers are hardware-neutral, or "platform independent", - except that they sometimes must understand quirks or limitations - of the particular controllers they work with. For example, when - a controller doesn't support alternate configurations or provide - enough of the right types of endpoints, the gadget driver might - not be able work with that controller, or might need to implement - a less common variant of a device class protocol. - - The available choices each represent a single precomposed USB - gadget configuration. In the device model, each option contains - both the device instantiation as a child for a USB gadget - controller, and the relevant drivers for each function declared - by the device. - -endchoice - source "drivers/usb/gadget/legacy/Kconfig" endif # USB_GADGET diff --git a/drivers/usb/gadget/legacy/Kconfig b/drivers/usb/gadget/legacy/Kconfig index 9570bbeced4f..2d80a9d1d5d9 100644 --- a/drivers/usb/gadget/legacy/Kconfig +++ b/drivers/usb/gadget/legacy/Kconfig @@ -21,6 +21,32 @@ menuconfig USB_GADGET_LEGACY if USB_GADGET_LEGACY +choice + tristate "USB Gadget precomposed configurations" + default USB_ETH + optional + help + A Linux "Gadget Driver" talks to the USB Peripheral Controller + driver through the abstract "gadget" API. Some other operating + systems call these "client" drivers, of which "class drivers" + are a subset (implementing a USB device class specification). + A gadget driver implements one or more USB functions using + the peripheral hardware. + + Gadget drivers are hardware-neutral, or "platform independent", + except that they sometimes must understand quirks or limitations + of the particular controllers they work with. For example, when + a controller doesn't support alternate configurations or provide + enough of the right types of endpoints, the gadget driver might + not be able work with that controller, or might need to implement + a less common variant of a device class protocol. + + The available choices each represent a single precomposed USB + gadget configuration. In the device model, each option contains + both the device instantiation as a child for a USB gadget + controller, and the relevant drivers for each function declared + by the device. + config USB_ZERO tristate "Gadget Zero (DEVELOPMENT)" select USB_LIBCOMPOSITE @@ -499,4 +525,6 @@ config USB_G_WEBCAM Say "y" to link the driver statically, or "m" to build a dynamically linked module called "g_webcam". +endchoice + endif -- 2.9.0