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>
        if (ret < 0)
                return ret;
 
-       dep->resource_index = dwc3_gadget_ep_get_transfer_index(dep);
+       dwc3_gadget_ep_get_transfer_index(dep);
        dwc->ep0_next_event = DWC3_EP0_COMPLETE;
 
        return 0;
 
                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:
                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;
 }
 
  * 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 */