diff options
author | Tom Rini <trini@konsulko.com> | 2016-01-02 12:24:43 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-01-02 12:24:43 -0500 |
commit | d83c25c318564080ce647795e5ee49133b97e87d (patch) | |
tree | 90a3a706c345d8f64f415ecdc22e8ff0efa3bf73 /drivers/usb/host/dwc2.c | |
parent | 8e8106dcd540e4c735da6a0b71919747c15ce93a (diff) | |
parent | ac3abf0b7d3a0c59a8a6697efbe9187692f199f0 (diff) |
Merge git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers/usb/host/dwc2.c')
-rw-r--r-- | drivers/usb/host/dwc2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index 541c0f9687..5ef6debd9a 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -823,12 +823,13 @@ int chunk_msg(struct dwc2_priv *priv, struct usb_device *dev, (*pid << DWC2_HCTSIZ_PID_OFFSET), &hc_regs->hctsiz); - if (!in) { - memcpy(priv->aligned_buffer, (char *)buffer + done, len); + if (!in && xfer_len) { + memcpy(priv->aligned_buffer, (char *)buffer + done, + xfer_len); flush_dcache_range((unsigned long)priv->aligned_buffer, (unsigned long)((void *)priv->aligned_buffer + - roundup(len, ARCH_DMA_MINALIGN))); + roundup(xfer_len, ARCH_DMA_MINALIGN))); } writel(phys_to_bus((unsigned long)priv->aligned_buffer), |