summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/gadget.h
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.h
parentf62afb4929a83cb7e81bd2ac411f2d4977716cf6 (diff)
downloadlinux-4439661d64f5afa77f2df1e3450da5e22ab6532e.tar.xz
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.h')
-rw-r--r--drivers/usb/dwc3/gadget.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h
index 578aa856f986..db610c56f1d6 100644
--- a/drivers/usb/dwc3/gadget.h
+++ b/drivers/usb/dwc3/gadget.h
@@ -98,13 +98,12 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol);
* Caller should take care of locking. Returns the transfer resource
* index for a given endpoint.
*/
-static inline u32 dwc3_gadget_ep_get_transfer_index(struct dwc3_ep *dep)
+static inline void dwc3_gadget_ep_get_transfer_index(struct dwc3_ep *dep)
{
u32 res_id;
res_id = dwc3_readl(dep->regs, DWC3_DEPCMD);
-
- return DWC3_DEPCMD_GET_RSC_IDX(res_id);
+ dep->resource_index = DWC3_DEPCMD_GET_RSC_IDX(res_id);
}
#endif /* __DRIVERS_USB_DWC3_GADGET_H */