summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_subset.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-05-28 09:15:55 +0200
committerFelipe Balbi <balbi@ti.com>2013-06-10 17:58:07 +0300
commit74bf963d1d230b0cedbcbc46f6f15f20c2e3ee55 (patch)
tree0826652dbd42885cd2a8ba7f463a2ae1290c5ed8 /drivers/usb/gadget/f_subset.c
parent8af5232d6f48896b151898ccb2e9e155481bb785 (diff)
usb: gadget: f_subset: use usb_gstrings_attach
use the 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/f_subset.c')
-rw-r--r--drivers/usb/gadget/f_subset.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c
index 5ae0bf61242..089881a530d 100644
--- a/drivers/usb/gadget/f_subset.c
+++ b/drivers/usb/gadget/f_subset.c
@@ -296,6 +296,7 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
{
struct usb_composite_dev *cdev = c->cdev;
struct f_gether *geth = func_to_geth(f);
+ struct usb_string *us;
int status;
struct usb_ep *ep;
@@ -319,14 +320,13 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
gether_opts->bound = true;
}
#endif
- /* maybe allocate device-global string IDs */
- if (geth_string_defs[0].id == 0) {
- status = usb_string_ids_tab(c->cdev, geth_string_defs);
- if (status < 0)
- return status;
- subset_data_intf.iInterface = geth_string_defs[0].id;
- ether_desc.iMACAddress = geth_string_defs[1].id;
- }
+ us = usb_gstrings_attach(cdev, geth_strings,
+ ARRAY_SIZE(geth_string_defs));
+ if (IS_ERR(us))
+ return PTR_ERR(us);
+
+ subset_data_intf.iInterface = us[0].id;
+ ether_desc.iMACAddress = us[1].id;
/* allocate instance-specific interface IDs */
status = usb_interface_id(c, f);
@@ -432,7 +432,6 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
geth->port.cdc_filter = DEFAULT_FILTER;
geth->port.func.name = "cdc_subset";
- geth->port.func.strings = geth_strings;
geth->port.func.bind = geth_bind;
geth->port.func.unbind = geth_old_unbind;
geth->port.func.set_alt = geth_set_alt;
@@ -514,7 +513,6 @@ static struct usb_function *geth_alloc(struct usb_function_instance *fi)
geth->port.cdc_filter = DEFAULT_FILTER;
geth->port.func.name = "cdc_subset";
- geth->port.func.strings = geth_strings;
geth->port.func.bind = geth_bind;
geth->port.func.unbind = geth_unbind;
geth->port.func.set_alt = geth_set_alt;