diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-10 09:01:57 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 09:13:02 -0400 |
commit | d33f74fce3756d51a0203cec3d0d278e3b48d827 (patch) | |
tree | 2037aa5d113165f9d6379d2415b31837cc44e006 /drivers/usb/gadget/composite.c | |
parent | 2d35ee47aaafac152bc4bc5020660ffa1753ab02 (diff) |
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.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 47b9130968bc..f3689e1bf4b2 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, | |||
904 | * check if the string has not been overridden. | 904 | * check if the string has not been overridden. |
905 | */ | 905 | */ |
906 | if (cdev->manufacturer_override == id) | 906 | if (cdev->manufacturer_override == id) |
907 | str = composite->iManufacturer ?: composite_manufacturer; | 907 | str = composite_manufacturer; |
908 | else if (cdev->product_override == id) | ||
909 | str = composite->iProduct; | ||
910 | else if (cdev->serial_override == id) | ||
911 | str = composite->iSerialNumber; | ||
912 | else | 908 | else |
913 | str = NULL; | 909 | str = NULL; |
914 | if (str) { | 910 | if (str) { |
@@ -1483,26 +1479,17 @@ static int composite_bind(struct usb_gadget *gadget, | |||
1483 | 1479 | ||
1484 | /* string overrides */ | 1480 | /* string overrides */ |
1485 | if (!cdev->desc.iManufacturer) { | 1481 | if (!cdev->desc.iManufacturer) { |
1486 | if (!composite->iManufacturer) | 1482 | snprintf(composite_manufacturer, |
1487 | snprintf(composite_manufacturer, | 1483 | sizeof composite_manufacturer, |
1488 | sizeof composite_manufacturer, | 1484 | "%s %s with %s", |
1489 | "%s %s with %s", | 1485 | init_utsname()->sysname, |
1490 | init_utsname()->sysname, | 1486 | init_utsname()->release, |
1491 | init_utsname()->release, | 1487 | gadget->name); |
1492 | gadget->name); | ||
1493 | 1488 | ||
1494 | cdev->manufacturer_override = | 1489 | cdev->manufacturer_override = |
1495 | override_id(cdev, &cdev->desc.iManufacturer); | 1490 | override_id(cdev, &cdev->desc.iManufacturer); |
1496 | } | 1491 | } |
1497 | 1492 | ||
1498 | if (!cdev->desc.iProduct && composite->iProduct) | ||
1499 | cdev->product_override = | ||
1500 | override_id(cdev, &cdev->desc.iProduct); | ||
1501 | |||
1502 | if (composite->iSerialNumber) | ||
1503 | cdev->serial_override = | ||
1504 | override_id(cdev, &cdev->desc.iSerialNumber); | ||
1505 | |||
1506 | /* has userspace failed to provide a serial number? */ | 1493 | /* has userspace failed to provide a serial number? */ |
1507 | if (composite->needs_serial && !cdev->desc.iSerialNumber) | 1494 | if (composite->needs_serial && !cdev->desc.iSerialNumber) |
1508 | WARNING(cdev, "userspace failed to provide iSerialNumber\n"); | 1495 | WARNING(cdev, "userspace failed to provide iSerialNumber\n"); |
@@ -1619,8 +1606,6 @@ int usb_composite_probe(struct usb_composite_driver *driver) | |||
1619 | 1606 | ||
1620 | if (!driver->name) | 1607 | if (!driver->name) |
1621 | driver->name = "composite"; | 1608 | driver->name = "composite"; |
1622 | if (!driver->iProduct) | ||
1623 | driver->iProduct = driver->name; | ||
1624 | 1609 | ||
1625 | driver->gadget_driver = composite_driver_template; | 1610 | driver->gadget_driver = composite_driver_template; |
1626 | gadget_driver = &driver->gadget_driver; | 1611 | gadget_driver = &driver->gadget_driver; |