aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/function/f_hid.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index df3cc32d1d23..dfdb4327ef3e 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -582,18 +582,17 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
582{ 582{
583 struct usb_ep *ep; 583 struct usb_ep *ep;
584 struct f_hidg *hidg = func_to_hidg(f); 584 struct f_hidg *hidg = func_to_hidg(f);
585 struct usb_string *us;
585 struct device *device; 586 struct device *device;
586 int status; 587 int status;
587 dev_t dev; 588 dev_t dev;
588 589
589 /* maybe allocate device-global string IDs, and patch descriptors */ 590 /* maybe allocate device-global string IDs, and patch descriptors */
590 if (ct_func_string_defs[CT_FUNC_HID_IDX].id == 0) { 591 us = usb_gstrings_attach(c->cdev, ct_func_strings,
591 status = usb_string_id(c->cdev); 592 ARRAY_SIZE(ct_func_string_defs));
592 if (status < 0) 593 if (IS_ERR(us))
593 return status; 594 return PTR_ERR(us);
594 ct_func_string_defs[CT_FUNC_HID_IDX].id = status; 595 hidg_interface_desc.iInterface = us[CT_FUNC_HID_IDX].id;
595 hidg_interface_desc.iInterface = status;
596 }
597 596
598 /* allocate instance-specific interface IDs, and patch descriptors */ 597 /* allocate instance-specific interface IDs, and patch descriptors */
599 status = usb_interface_id(c, f); 598 status = usb_interface_id(c, f);
@@ -806,7 +805,6 @@ struct usb_function *hidg_alloc(struct usb_function_instance *fi)
806 } 805 }
807 806
808 hidg->func.name = "hid"; 807 hidg->func.name = "hid";
809 hidg->func.strings = ct_func_strings;
810 hidg->func.bind = hidg_bind; 808 hidg->func.bind = hidg_bind;
811 hidg->func.unbind = hidg_unbind; 809 hidg->func.unbind = hidg_unbind;
812 hidg->func.set_alt = hidg_set_alt; 810 hidg->func.set_alt = hidg_set_alt;