summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zimmerman <Paul.Zimmerman@synopsys.com>2011-09-30 11:58:45 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-04 21:25:53 +0400
commitc439ef87c33a1df30f528cb152151465c2529cac (patch)
treeceb364adaef586bbd65dab320cae2dc5bb7d0d9e
parent5275455a6e6ae6b57303834b0afd267bb9657ffc (diff)
downloadlinux-c439ef87c33a1df30f528cb152151465c2529cac.tar.xz
usb: dwc3: gadget: fix DMA offset calculation
Fix offset calculation in dwc3_trb_dma_offset() Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 16f2ba614fc0..ee5c1a519713 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -189,7 +189,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
static dma_addr_t dwc3_trb_dma_offset(struct dwc3_ep *dep,
struct dwc3_trb_hw *trb)
{
- u32 offset = trb - dep->trb_pool;
+ u32 offset = (char *) trb - (char *) dep->trb_pool;
return dep->trb_pool_dma + offset;
}