Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1325374
| From | Robert Baldyga <r.baldyga@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 39/43] usb: gadget: u_ether: remove usb_ep_enable()/usb_ep_disable() |
| Date | 2016-02-03 13:50 +0100 |
| Message-ID | <qY52J-212-87@gated-at.bofh.it> (permalink) |
| References | <qY52F-212-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
As we have automatic endpoint state handling it's no longer needed.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
drivers/usb/gadget/function/u_ether.c | 28 ++--------------------------
1 file changed, 2 insertions(+), 26 deletions(-)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 637809e..9d23842 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -1041,20 +1041,7 @@ struct net_device *gether_connect(struct gether *link)
return ERR_PTR(-EINVAL);
link->in_ep->driver_data = dev;
- result = usb_ep_enable(link->in_ep);
- if (result != 0) {
- DBG(dev, "enable %s --> %d\n",
- link->in_ep->name, result);
- goto fail0;
- }
-
link->out_ep->driver_data = dev;
- result = usb_ep_enable(link->out_ep);
- if (result != 0) {
- DBG(dev, "enable %s --> %d\n",
- link->out_ep->name, result);
- goto fail1;
- }
if (result == 0)
result = alloc_requests(dev, link, qlen(dev->gadget,
@@ -1082,14 +1069,8 @@ struct net_device *gether_connect(struct gether *link)
netif_carrier_on(dev->net);
if (netif_running(dev->net))
eth_start(dev, GFP_ATOMIC);
-
- /* on error, disable any endpoints */
- } else {
- (void) usb_ep_disable(link->out_ep);
-fail1:
- (void) usb_ep_disable(link->in_ep);
}
-fail0:
+
/* caller is responsible for cleanup on error */
if (result < 0)
return ERR_PTR(result);
@@ -1123,11 +1104,7 @@ void gether_disconnect(struct gether *link)
netif_stop_queue(dev->net);
netif_carrier_off(dev->net);
- /* disable endpoints, forcing (synchronous) completion
- * of all pending i/o. then free the request objects
- * and forget about the endpoints.
- */
- usb_ep_disable(link->in_ep);
+ /* free the request objects and forget about the endpoints. */
spin_lock(&dev->req_lock);
while (!list_empty(&dev->tx_reqs)) {
req = container_of(dev->tx_reqs.next,
@@ -1141,7 +1118,6 @@ void gether_disconnect(struct gether *link)
spin_unlock(&dev->req_lock);
link->in_ep->desc = NULL;
- usb_ep_disable(link->out_ep);
spin_lock(&dev->req_lock);
while (!list_empty(&dev->rx_reqs)) {
req = container_of(dev->rx_reqs.next,
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 00/43] usb: gadget: composite: introduce new function API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 10/43] usb: gadget: composite: handle vendor descs Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 16/43] usb: gadget: composite: add usb_function_get_ep() function Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 24/43] usb: gadget: f_rndis: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 18/43] usb: gadget: composite: usb_get_endpoint_address() function Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 06/43] usb: gadget: composite: introduce new descriptors format Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
Re: [PATCH v4 06/43] usb: gadget: composite: introduce new descriptors format kbuild test robot <lkp@intel.com> - 2016-02-04 06:20 +0100
[PATCH v4 15/43] usb: gadget: composite: handle get_alt() automatically Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 04/43] usb: gadget: configfs: fix error path Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 37/43] usb: gadget: f_mass_storage: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 23/43] usb: gadget: f_ecm: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 02/43] usb: gadget: f_sourcesink: free requests in sourcesink_disable() Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 13/43] usb: gadget: composite: enable eps before calling set_alt() callback Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 32/43] usb: gadget: f_obex: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 20/43] usb: gadget: configfs: add new composite API support Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 27/43] usb: gadget: f_acm: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 26/43] usb: gadget: f_hid: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 30/43] usb: gadget: f_printer: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 08/43] usb: gadget: composite: introduce new USB function ops Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 35/43] usb: gadget: f_uac1: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 31/43] usb: gadget: f_serial: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 42/43] Documentation: update uvc configfs interface description Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 43/43] usb: gadget: f_uvc: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 25/43] usb: gadget: f_hid: handle requests lifetime properly Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 03/43] usb: gadget: f_loopback: free requests in loopback_disable() Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 38/43] usb: gadget: u_serial: remove usb_ep_enable()/usb_ep_disable() Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 34/43] usb: gadget: f_subset: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 29/43] usb: gadget: f_ncm: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 22/43] usb: gadget: f_sourcesink: convert to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 39/43] usb: gadget: u_ether: remove usb_ep_enable()/usb_ep_disable() Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 40/43] usb: gadget: uvc: fix typo in UVCG_OPTS_ATTR() macro Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 36/43] usb: gadget: f_uac2: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 41/43] usb: gadget: uvc: simplify descriptors generation Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 13:50 +0100
[PATCH v4 09/43] usb: gadget: composite: handle function bind Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
Re: [PATCH v4 09/43] usb: gadget: composite: handle function bind kbuild test robot <lkp@intel.com> - 2016-02-04 06:50 +0100
[PATCH v4 01/43] usb: gadget: f_sourcesink: make ISO altset user-selectable Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 12/43] usb: gadget: composite: disable eps before calling disable() callback Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 17/43] usb: gadget: composite: add usb_get_interface_id() function Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 19/43] usb: gadget: composite: enable adding USB functions using new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 05/43] usb: gadget: composite: fix recursive spinlock locking Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 21/43] usb: gadget: f_loopback: convert to new API Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 14/43] usb: gadget: composite: introduce clear_alt() operation Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 11/43] usb: gadget: composite: generate old descs for compatibility Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
[PATCH v4 07/43] usb: gadget: composite: add functions for descriptors handling Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 14:00 +0100
csiph-web