summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2018-04-11 12:56:24 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-05-21 10:01:00 +0300
commit4439661d64f5afa77f2df1e3450da5e22ab6532e (patch)
tree4b2cb5714a788c4560eef0abef64d27628402f00 /drivers/usb/dwc3/gadget.c
parentf62afb4929a83cb7e81bd2ac411f2d4977716cf6 (diff)
downloadlinux-4439661d64f5afa77f2df1e3450da5e22ab6532e.tar.gz
linux-4439661d64f5afa77f2df1e3450da5e22ab6532e.tar.bz2
linux-4439661d64f5afa77f2df1e3450da5e22ab6532e.zip
usb: dwc3: gadget: assign resource_index inside get_transfer_index()
Instead of returning resource index number just to assign it to a field inside 'dep' which was passed as argument, we can assing dep->resource_index from inside dwc3_gadget_ep_get_transfer_index() itself. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index abdc3ac24cc6..9e4db9cdb95e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -683,8 +683,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep, unsigned int action)
if (ret < 0)
return ret;
- dep->resource_index = dwc3_gadget_ep_get_transfer_index(dep);
- WARN_ON_ONCE(!dep->resource_index);
+ dwc3_gadget_ep_get_transfer_index(dep);
}
out:
@@ -1245,10 +1244,8 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
return ret;
}
- if (starting) {
- dep->resource_index = dwc3_gadget_ep_get_transfer_index(dep);
- WARN_ON_ONCE(!dep->resource_index);
- }
+ if (starting)
+ dwc3_gadget_ep_get_transfer_index(dep);
return 0;
}