diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-06 20:11:21 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 16:13:00 +0300 |
commit | 276e2e4f1f3e07a0ad891bf757dbcfd655ff5f91 (patch) | |
tree | 5a3d0689815314e2fab55a8c9e0a99d6853c31bd /drivers/usb/gadget/tcm_usb_gadget.c | |
parent | 7d16e8d3eb704f5f6eb5a271d5758b495634e8e6 (diff) |
usb: gadget: make sure each gadget is using same index for Product, Serial,…
The index in usb_string array is defined by the gadget. The gadget can
choose which index entry it assigns for the serial number and which the
product name. The gadget has just to ensure that the descriptor contains
the proper string id which is assigned by composite.
If the composite layer knows the index of the "default" information
which will be overwritten by module parameters, it can be used later to
overwrite it.
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/tcm_usb_gadget.c')
-rw-r--r-- | drivers/usb/gadget/tcm_usb_gadget.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index fa3137ef228..b56d57d5979 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c @@ -2210,9 +2210,9 @@ static struct usb_device_descriptor usbg_device_desc = { }; static struct usb_string usbg_us_strings[] = { - [USB_G_STR_MANUFACTOR].s = "Target Manufactor", - [USB_G_STR_PRODUCT].s = "Target Product", - [USB_G_STR_SERIAL].s = "000000000001", + [USB_GADGET_MANUFACTURER_IDX].s = "Target Manufactor", + [USB_GADGET_PRODUCT_IDX].s = "Target Product", + [USB_GADGET_SERIAL_IDX].s = "000000000001", [USB_G_STR_CONFIG].s = "default config", [USB_G_STR_INT_UAS].s = "USB Attached SCSI", [USB_G_STR_INT_BBB].s = "Bulk Only Transport", @@ -2431,9 +2431,10 @@ static int usb_target_bind(struct usb_composite_dev *cdev) return ret; usbg_device_desc.iManufacturer = - usbg_us_strings[USB_G_STR_MANUFACTOR].id; - usbg_device_desc.iProduct = usbg_us_strings[USB_G_STR_PRODUCT].id; - usbg_device_desc.iSerialNumber = usbg_us_strings[USB_G_STR_SERIAL].id; + usbg_us_strings[USB_GADGET_MANUFACTURER_IDX].id; + usbg_device_desc.iProduct = usbg_us_strings[USB_GADGET_PRODUCT_IDX].id; + usbg_device_desc.iSerialNumber = + usbg_us_strings[USB_GADGET_SERIAL_IDX].id; usbg_config_driver.iConfiguration = usbg_us_strings[USB_G_STR_CONFIG].id; |