summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-10 15:01:57 +0200
committerFelipe Balbi <balbi@ti.com>2012-09-10 16:13:02 +0300
commitd33f74fce3756d51a0203cec3d0d278e3b48d827 (patch)
tree2037aa5d113165f9d6379d2415b31837cc44e006 /drivers/usb/gadget/composite.c
parent2d35ee47aaafac152bc4bc5020660ffa1753ab02 (diff)
downloadop-kernel-dev-d33f74fce3756d51a0203cec3d0d278e3b48d827.zip
op-kernel-dev-d33f74fce3756d51a0203cec3d0d278e3b48d827.tar.gz
usb: gadget: remove string override from struct usb_composite_driver
The struct usb_composite_driver members iProduct, iSerial and iManufacturer can be entered directly via the string array. There is no need for them to appear here. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 47b9130..f3689e1 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -904,11 +904,7 @@ static int get_string(struct usb_composite_dev *cdev,
* check if the string has not been overridden.
*/
if (cdev->manufacturer_override == id)
- str = composite->iManufacturer ?: composite_manufacturer;
- else if (cdev->product_override == id)
- str = composite->iProduct;
- else if (cdev->serial_override == id)
- str = composite->iSerialNumber;
+ str = composite_manufacturer;
else
str = NULL;
if (str) {
@@ -1483,26 +1479,17 @@ static int composite_bind(struct usb_gadget *gadget,
/* string overrides */
if (!cdev->desc.iManufacturer) {
- if (!composite->iManufacturer)
- snprintf(composite_manufacturer,
- sizeof composite_manufacturer,
- "%s %s with %s",
- init_utsname()->sysname,
- init_utsname()->release,
- gadget->name);
+ snprintf(composite_manufacturer,
+ sizeof composite_manufacturer,
+ "%s %s with %s",
+ init_utsname()->sysname,
+ init_utsname()->release,
+ gadget->name);
cdev->manufacturer_override =
override_id(cdev, &cdev->desc.iManufacturer);
}
- if (!cdev->desc.iProduct && composite->iProduct)
- cdev->product_override =
- override_id(cdev, &cdev->desc.iProduct);
-
- if (composite->iSerialNumber)
- cdev->serial_override =
- override_id(cdev, &cdev->desc.iSerialNumber);
-
/* has userspace failed to provide a serial number? */
if (composite->needs_serial && !cdev->desc.iSerialNumber)
WARNING(cdev, "userspace failed to provide iSerialNumber\n");
@@ -1619,8 +1606,6 @@ int usb_composite_probe(struct usb_composite_driver *driver)
if (!driver->name)
driver->name = "composite";
- if (!driver->iProduct)
- driver->iProduct = driver->name;
driver->gadget_driver = composite_driver_template;
gadget_driver = &driver->gadget_driver;
OpenPOWER on IntegriCloud