summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-05-28 09:16:00 +0200
committerFelipe Balbi <balbi@ti.com>2013-06-10 17:58:10 +0300
commit4e75e7275652824395696ba1e34c10d368958caf (patch)
tree24dc67a9a725de915d8cadb8739d358d6c8def8b /drivers/usb/gadget
parent76da66d1708d9df4cffa148546853b43249f4d76 (diff)
usb: gadget: f_rndis: use usb_gstrings_attach
use new usb_gstrings_attach interface Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_rndis.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index e5c6aee02fd..4045ca24e7c 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -670,6 +670,7 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
{
struct usb_composite_dev *cdev = c->cdev;
struct f_rndis *rndis = func_to_rndis(f);
+ struct usb_string *us;
int status;
struct usb_ep *ep;
@@ -696,16 +697,13 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
rndis_opts->bound = true;
}
#endif
-
- if (rndis_string_defs[0].id == 0) {
- status = usb_string_ids_tab(c->cdev, rndis_string_defs);
- if (status)
- return status;
-
- rndis_control_intf.iInterface = rndis_string_defs[0].id;
- rndis_data_intf.iInterface = rndis_string_defs[1].id;
- rndis_iad_descriptor.iFunction = rndis_string_defs[2].id;
- }
+ us = usb_gstrings_attach(cdev, rndis_strings,
+ ARRAY_SIZE(rndis_string_defs));
+ if (IS_ERR(us))
+ return PTR_ERR(us);
+ rndis_control_intf.iInterface = us[0].id;
+ rndis_data_intf.iInterface = us[1].id;
+ rndis_iad_descriptor.iFunction = us[2].id;
/* allocate instance-specific interface IDs */
status = usb_interface_id(c, f);
@@ -840,7 +838,6 @@ rndis_old_unbind(struct usb_configuration *c, struct usb_function *f)
rndis_deregister(rndis->config);
- rndis_string_defs[0].id = 0;
usb_free_all_descriptors(f);
kfree(rndis->notify_req->buf);
@@ -876,7 +873,6 @@ rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
rndis->port.unwrap = rndis_rm_hdr;
rndis->port.func.name = "rndis";
- rndis->port.func.strings = rndis_strings;
/* descriptors are per-instance copies */
rndis->port.func.bind = rndis_bind;
rndis->port.func.unbind = rndis_old_unbind;
@@ -950,7 +946,6 @@ static void rndis_unbind(struct usb_configuration *c, struct usb_function *f)
{
struct f_rndis *rndis = func_to_rndis(f);
- rndis_string_defs[0].id = 0;
usb_free_all_descriptors(f);
kfree(rndis->notify_req->buf);
@@ -984,7 +979,6 @@ static struct usb_function *rndis_alloc(struct usb_function_instance *fi)
rndis->port.unwrap = rndis_rm_hdr;
rndis->port.func.name = "rndis";
- rndis->port.func.strings = rndis_strings;
/* descriptors are per-instance copies */
rndis->port.func.bind = rndis_bind;
rndis->port.func.unbind = rndis_unbind;