aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/printer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/printer.c')
-rw-r--r--drivers/usb/gadget/printer.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
index 3fa4d80629cc..f02434a10dec 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -139,10 +139,6 @@ module_param(qlen, uint, S_IRUGO|S_IWUSR);
139 * descriptors are built on demand. 139 * descriptors are built on demand.
140 */ 140 */
141 141
142#define STRING_MANUFACTURER 0
143#define STRING_PRODUCT 1
144#define STRING_SERIALNUM 2
145
146/* holds our biggest descriptor */ 142/* holds our biggest descriptor */
147#define USB_DESC_BUFSIZE 256 143#define USB_DESC_BUFSIZE 256
148#define USB_BUFSIZE 8192 144#define USB_BUFSIZE 8192
@@ -250,9 +246,9 @@ static char pnp_string [1024] =
250 246
251/* static strings, in UTF-8 */ 247/* static strings, in UTF-8 */
252static struct usb_string strings [] = { 248static struct usb_string strings [] = {
253 [STRING_MANUFACTURER].s = manufacturer, 249 [USB_GADGET_MANUFACTURER_IDX].s = manufacturer,
254 [STRING_PRODUCT].s = product_desc, 250 [USB_GADGET_PRODUCT_IDX].s = product_desc,
255 [STRING_SERIALNUM].s = serial_num, 251 [USB_GADGET_SERIAL_IDX].s = serial_num,
256 { } /* end of list */ 252 { } /* end of list */
257}; 253};
258 254
@@ -1261,9 +1257,9 @@ static int __init printer_bind(struct usb_composite_dev *cdev)
1261 ret = usb_string_ids_tab(cdev, strings); 1257 ret = usb_string_ids_tab(cdev, strings);
1262 if (ret < 0) 1258 if (ret < 0)
1263 return ret; 1259 return ret;
1264 device_desc.iManufacturer = strings[STRING_MANUFACTURER].id; 1260 device_desc.iManufacturer = strings[USB_GADGET_MANUFACTURER_IDX].id;
1265 device_desc.iProduct = strings[STRING_PRODUCT].id; 1261 device_desc.iProduct = strings[USB_GADGET_PRODUCT_IDX].id;
1266 device_desc.iSerialNumber = strings[STRING_SERIALNUM].id; 1262 device_desc.iSerialNumber = strings[USB_GADGET_SERIAL_IDX].id;
1267 1263
1268 ret = usb_add_config(cdev, &printer_cfg_driver, printer_bind_config); 1264 ret = usb_add_config(cdev, &printer_cfg_driver, printer_bind_config);
1269 if (ret) 1265 if (ret)