On Fri, Sep 12, 2025, Thinh Nguyen wrote: > > > > > 2) OR we can use container_of(base, struct dwc3, regs)) to get dwc pointer, > > this will not work in few places where we use dep->regs (~6 places). we > > can just create a separate function dwc3_dep_readl/writel for dep->regs, > > We can just update the endpoint macros to something like this: > #define DWC3_DEPCMD(n) (DWC3_DEP_BASE(n) + 0x0c) Or we can just remove the DWC3_DEP_BASE and do as follow: #define DWC3_DEPCMDPAR2(n) (0xc800 + ((n) * 0x10)) #define DWC3_DEPCMDPAR1(n) (0xc804 + ((n) * 0x10)) #define DWC3_DEPCMDPAR0(n) (0xc808 + ((n) * 0x10)) #define DWC3_DEPCMD(n) (0xc80c + ((n) * 0x10)) > > so we can do this: > dwc3_readl(dwc->regs, DWC3_DEPCMD(dep->number)); >