aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/f_subset.c
diff options
context:
space:
mode:
authorRobert Baldyga <r.baldyga@samsung.com>2015-09-16 12:10:57 +0200
committerFelipe Balbi <balbi@ti.com>2015-09-27 10:54:31 -0500
commitbb38c18adb872714d5b27b0fe2d87c6489cb6275 (patch)
tree57772c7d189e51655030b048dfcd833a2bbe4960 /drivers/usb/gadget/function/f_subset.c
parentusb: gadget: f_sourcesink: eliminate abuse of ep->driver data (diff)
downloadlinux-dev-bb38c18adb872714d5b27b0fe2d87c6489cb6275.tar.xz
linux-dev-bb38c18adb872714d5b27b0fe2d87c6489cb6275.zip
usb: gadget: f_subset: eliminate abuse of ep->driver data
Since ep->driver_data is not used for endpoint claiming, neither for enabled/disabled state storing, we can reduce number of places where we read or modify it's value, as now it has no particular meaning for function or framework logic. In case of f_subset, ep->driver_data was used only for endpoint claiming and marking endpoints as enabled, so we can simplify code by reducing it. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_subset.c')
-rw-r--r--drivers/usb/gadget/function/f_subset.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/usb/gadget/function/f_subset.c b/drivers/usb/gadget/function/f_subset.c
index e3dfa675ff06..2e66e624e6e1 100644
--- a/drivers/usb/gadget/function/f_subset.c
+++ b/drivers/usb/gadget/function/f_subset.c
@@ -262,7 +262,7 @@ static int geth_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
/* we know alt == 0, so this is an activation or a reset */
- if (geth->port.in_ep->driver_data) {
+ if (geth->port.in_ep->enabled) {
DBG(cdev, "reset cdc subset\n");
gether_disconnect(&geth->port);
}
@@ -343,13 +343,11 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
if (!ep)
goto fail;
geth->port.in_ep = ep;
- ep->driver_data = cdev; /* claim */
ep = usb_ep_autoconfig(cdev->gadget, &fs_subset_out_desc);
if (!ep)
goto fail;
geth->port.out_ep = ep;
- ep->driver_data = cdev; /* claim */
/* support all relevant hardware speeds... we expect that when
* hardware is dual speed, all bulk-capable endpoints work at
@@ -380,12 +378,6 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
return 0;
fail:
- /* we might as well release our claims on endpoints */
- if (geth->port.out_ep)
- geth->port.out_ep->driver_data = NULL;
- if (geth->port.in_ep)
- geth->port.in_ep->driver_data = NULL;
-
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
return status;