diff options
Diffstat (limited to 'drivers/usb/gadget')
| -rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 30 | ||||
| -rw-r--r-- | drivers/usb/gadget/g_dnl.c | 17 | 
2 files changed, 12 insertions, 35 deletions
| diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 5b348d7a6..b34068a0b 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -6,35 +6,7 @@   *                    Author: Michal Nazarewicz <m.nazarewicz@samsung.com>   * All rights reserved.   * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *    notice, this list of conditions, and the following disclaimer, - *    without modification. - * 2. Redistributions in binary form must reproduce the above copyright - *    notice, this list of conditions and the following disclaimer in the - *    documentation and/or other materials provided with the distribution. - * 3. The names of the above-listed copyright holders may not be used - *    to endorse or promote products derived from this software without - *    specific prior written permission. - * - * ALTERNATIVELY, this software may be distributed under the terms of the - * GNU General Public License ("GPL") as published by the Free Software - * Foundation, either version 2 of that License or (at your option) any - * later version. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0+	BSD-3-Clause   */ diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index cbfcb2d07..a3e05a872 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -31,8 +31,10 @@  #define STRING_MANUFACTURER 25  #define STRING_PRODUCT 2 +/* Index of String Descriptor describing this configuration */  #define STRING_USBDOWN 2 -#define CONFIG_USBDOWNLOADER 2 +/* Number of supported configurations */ +#define CONFIGURATION_NUMBER 1  #define DRIVER_VERSION		"usb_dnl 2.0" @@ -54,11 +56,14 @@ static struct usb_device_descriptor device_desc = {  	.bNumConfigurations = 1,  }; -/* static strings, in UTF-8 */ +/* + * static strings, in UTF-8 + * IDs for those strings are assigned dynamically at g_dnl_bind() + */  static struct usb_string g_dnl_string_defs[] = { -	{ 0, manufacturer, }, -	{ 1, product, }, -	{  }		/* end of list */ +	{.s = manufacturer}, +	{.s = product}, +	{ }		/* end of list */  };  static struct usb_gadget_strings g_dnl_string_tab = { @@ -104,7 +109,7 @@ static int g_dnl_config_register(struct usb_composite_dev *cdev)  	static struct usb_configuration config = {  		.label = "usb_dnload",  		.bmAttributes =	USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, -		.bConfigurationValue =	CONFIG_USBDOWNLOADER, +		.bConfigurationValue =	CONFIGURATION_NUMBER,  		.iConfiguration =	STRING_USBDOWN,  		.bind = g_dnl_do_config, |