There are no old function interface users left, so the old interface can be removed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx --- drivers/usb/gadget/f_ncm.c | 81 +----------------------------------------- drivers/usb/gadget/u_ether.h | 2 - 2 files changed, 1 insertions(+), 82 deletions(-) diff --git a/drivers/usb/gadget/f_ncm.c b/drivers/usb/gadget/f_ncm.c index d46c704..cb63840 100644 --- a/drivers/usb/gadget/f_ncm.c +++ b/drivers/usb/gadget/f_ncm.c @@ -1160,8 +1160,6 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) struct f_ncm *ncm = func_to_ncm(f); int status; struct usb_ep *ep; - -#ifndef USB_FNCM_INCLUDED struct f_ncm_opts *ncm_opts; if (!can_support_ecm(cdev->gadget)) @@ -1170,7 +1168,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f) ncm_opts = container_of(f->fi, struct f_ncm_opts, func_inst); if (!ncm_opts->ethaddr) return -EINVAL; -#endif + if (ncm_string_defs[0].id == 0) { status = usb_string_ids_tab(c->cdev, ncm_string_defs); if (status < 0) @@ -1285,80 +1283,6 @@ fail: return status; } -#ifdef USB_FNCM_INCLUDED - -static void -ncm_old_unbind(struct usb_configuration *c, struct usb_function *f) -{ - struct f_ncm *ncm = func_to_ncm(f); - - DBG(c->cdev, "ncm unbind\n"); - - ncm_string_defs[0].id = 0; - usb_free_all_descriptors(f); - - kfree(ncm->notify_req->buf); - usb_ep_free_request(ncm->notify, ncm->notify_req); - - kfree(ncm); -} - -/** - * ncm_bind_config - add CDC Network link to a configuration - * @c: the configuration to support the network link - * @ethaddr: a buffer in which the ethernet address of the host side - * side of the link was recorded - * Context: single threaded during gadget setup - * - * Returns zero on success, else negative errno. - * - * Caller must have called @gether_setup(). Caller is also responsible - * for calling @gether_cleanup() before module unload. - */ -int __init ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], - struct eth_dev *dev) -{ - struct f_ncm *ncm; - int status; - - if (!can_support_ecm(c->cdev->gadget) || !ethaddr) - return -EINVAL; - - /* allocate and initialize one new instance */ - ncm = kzalloc(sizeof *ncm, GFP_KERNEL); - if (!ncm) - return -ENOMEM; - - /* export host's Ethernet address in CDC format */ - snprintf(ncm->ethaddr, sizeof ncm->ethaddr, "%pm", ethaddr); - ncm_string_defs[STRING_MAC_IDX].s = ncm->ethaddr; - - spin_lock_init(&ncm->lock); - ncm_reset_values(ncm); - ncm->port.ioport = dev; - ncm->port.is_fixed = true; - - ncm->port.func.name = "cdc_network"; - ncm->port.func.strings = ncm_strings; - /* descriptors are per-instance copies */ - ncm->port.func.bind = ncm_bind; - ncm->port.func.unbind = ncm_old_unbind; - ncm->port.func.set_alt = ncm_set_alt; - ncm->port.func.get_alt = ncm_get_alt; - ncm->port.func.setup = ncm_setup; - ncm->port.func.disable = ncm_disable; - - ncm->port.wrap = ncm_wrap_ntb; - ncm->port.unwrap = ncm_unwrap_ntb; - - status = usb_add_function(c, &ncm->port.func); - if (status) - kfree(ncm); - return status; -} - -#else - static void ncm_free_inst(struct usb_function_instance *f) { struct f_ncm_opts *opts; @@ -1441,6 +1365,3 @@ struct usb_function *ncm_alloc(struct usb_function_instance *fi) DECLARE_USB_FUNCTION_INIT(ncm, ncm_alloc_inst, ncm_alloc); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Yauheni Kaliuta"); - -#endif - diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h index 0252233..82adf9f 100644 --- a/drivers/usb/gadget/u_ether.h +++ b/drivers/usb/gadget/u_ether.h @@ -117,8 +117,6 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], struct eth_dev *dev); int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], struct eth_dev *dev); -int ncm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN], - struct eth_dev *dev); int eem_bind_config(struct usb_configuration *c, struct eth_dev *dev); #ifdef USB_ETH_RNDIS -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html