summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-05-23 10:51:13 +0200
committerFelipe Balbi <balbi@ti.com>2013-06-10 17:31:55 +0300
commit0383070e8d904f006b6eaffceb3fae4cdd25c01a (patch)
tree2437b1ec77c157ae44fad31e52c1bf732f0c2027 /drivers
parent83167f12da059799072128e91ab692613d8237ee (diff)
usb: gadget: f_phonet: remove compatibility layer
There are no old function interface users left, so the old interface can be removed. 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')
-rw-r--r--drivers/usb/gadget/f_phonet.c84
-rw-r--r--drivers/usb/gadget/u_phonet.h1
2 files changed, 4 insertions, 81 deletions
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index a667dfe453db..5dd774876168 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -581,55 +581,6 @@ err:
return status;
}
-#ifdef USBF_PHONET_INCLUDED
-
-static void
-pn_old_unbind(struct usb_configuration *c, struct usb_function *f)
-{
- struct f_phonet *fp = func_to_pn(f);
- int i;
-
- /* We are already disconnected */
- if (fp->in_req)
- usb_ep_free_request(fp->in_ep, fp->in_req);
- for (i = 0; i < phonet_rxq_size; i++)
- if (fp->out_reqv[i])
- usb_ep_free_request(fp->out_ep, fp->out_reqv[i]);
-
- usb_free_all_descriptors(f);
- kfree(fp);
-}
-
-/*-------------------------------------------------------------------------*/
-
-int __init phonet_bind_config(struct usb_configuration *c,
- struct net_device *dev)
-{
- struct f_phonet *fp;
- int err, size;
-
- size = sizeof(*fp) + (phonet_rxq_size * sizeof(struct usb_request *));
- fp = kzalloc(size, GFP_KERNEL);
- if (!fp)
- return -ENOMEM;
-
- fp->dev = dev;
- fp->function.name = "phonet";
- fp->function.bind = pn_bind;
- fp->function.unbind = pn_old_unbind;
- fp->function.set_alt = pn_set_alt;
- fp->function.get_alt = pn_get_alt;
- fp->function.disable = pn_disconnect;
- spin_lock_init(&fp->rx.lock);
-
- err = usb_add_function(c, &fp->function);
- if (err)
- kfree(fp);
- return err;
-}
-
-#else
-
static void phonet_free_inst(struct usb_function_instance *f)
{
struct f_phonet_opts *opts;
@@ -740,38 +691,11 @@ int gphonet_register_netdev(struct net_device *net)
return status;
}
-DECLARE_USB_FUNCTION_INIT(phonet, phonet_alloc_inst, phonet_alloc);
-MODULE_AUTHOR("Rémi Denis-Courmont");
-MODULE_LICENSE("GPL");
-
-#endif
-
-struct net_device *gphonet_setup(struct usb_gadget *gadget)
-{
- struct net_device *dev;
- struct phonet_port *port;
- int err;
-
- /* Create net device */
- dev = alloc_netdev(sizeof(*port), "upnlink%d", pn_net_setup);
- if (!dev)
- return ERR_PTR(-ENOMEM);
-
- port = netdev_priv(dev);
- spin_lock_init(&port->lock);
- netif_carrier_off(dev);
- SET_NETDEV_DEV(dev, &gadget->dev);
-
- err = register_netdev(dev);
- if (err) {
- free_netdev(dev);
-
- return ERR_PTR(err);
- }
- return dev;
-}
-
void gphonet_cleanup(struct net_device *dev)
{
unregister_netdev(dev);
}
+
+DECLARE_USB_FUNCTION_INIT(phonet, phonet_alloc_inst, phonet_alloc);
+MODULE_AUTHOR("Rémi Denis-Courmont");
+MODULE_LICENSE("GPL");
diff --git a/drivers/usb/gadget/u_phonet.h b/drivers/usb/gadget/u_phonet.h
index 1ff5ad5d3bf5..98ced18779ea 100644
--- a/drivers/usb/gadget/u_phonet.h
+++ b/drivers/usb/gadget/u_phonet.h
@@ -23,7 +23,6 @@ struct f_phonet_opts {
struct net_device *gphonet_setup_default(void);
void gphonet_set_gadget(struct net_device *net, struct usb_gadget *g);
int gphonet_register_netdev(struct net_device *net);
-struct net_device *gphonet_setup(struct usb_gadget *gadget);
int phonet_bind_config(struct usb_configuration *c, struct net_device *dev);
void gphonet_cleanup(struct net_device *dev);