Commit 74bf963d authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: f_subset: use usb_gstrings_attach

use the new usb_gstrings_attach interface.
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 8af5232d
...@@ -296,6 +296,7 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -296,6 +296,7 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
{ {
struct usb_composite_dev *cdev = c->cdev; struct usb_composite_dev *cdev = c->cdev;
struct f_gether *geth = func_to_geth(f); struct f_gether *geth = func_to_geth(f);
struct usb_string *us;
int status; int status;
struct usb_ep *ep; struct usb_ep *ep;
...@@ -319,14 +320,13 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) ...@@ -319,14 +320,13 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
gether_opts->bound = true; gether_opts->bound = true;
} }
#endif #endif
/* maybe allocate device-global string IDs */ us = usb_gstrings_attach(cdev, geth_strings,
if (geth_string_defs[0].id == 0) { ARRAY_SIZE(geth_string_defs));
status = usb_string_ids_tab(c->cdev, geth_string_defs); if (IS_ERR(us))
if (status < 0) return PTR_ERR(us);
return status;
subset_data_intf.iInterface = geth_string_defs[0].id; subset_data_intf.iInterface = us[0].id;
ether_desc.iMACAddress = geth_string_defs[1].id; ether_desc.iMACAddress = us[1].id;
}
/* allocate instance-specific interface IDs */ /* allocate instance-specific interface IDs */
status = usb_interface_id(c, f); status = usb_interface_id(c, f);
...@@ -432,7 +432,6 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], ...@@ -432,7 +432,6 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
geth->port.cdc_filter = DEFAULT_FILTER; geth->port.cdc_filter = DEFAULT_FILTER;
geth->port.func.name = "cdc_subset"; geth->port.func.name = "cdc_subset";
geth->port.func.strings = geth_strings;
geth->port.func.bind = geth_bind; geth->port.func.bind = geth_bind;
geth->port.func.unbind = geth_old_unbind; geth->port.func.unbind = geth_old_unbind;
geth->port.func.set_alt = geth_set_alt; geth->port.func.set_alt = geth_set_alt;
...@@ -514,7 +513,6 @@ static struct usb_function *geth_alloc(struct usb_function_instance *fi) ...@@ -514,7 +513,6 @@ static struct usb_function *geth_alloc(struct usb_function_instance *fi)
geth->port.cdc_filter = DEFAULT_FILTER; geth->port.cdc_filter = DEFAULT_FILTER;
geth->port.func.name = "cdc_subset"; geth->port.func.name = "cdc_subset";
geth->port.func.strings = geth_strings;
geth->port.func.bind = geth_bind; geth->port.func.bind = geth_bind;
geth->port.func.unbind = geth_unbind; geth->port.func.unbind = geth_unbind;
geth->port.func.set_alt = geth_set_alt; geth->port.func.set_alt = geth_set_alt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment