Instead on relying virt_to_phys() to do virtual-to-physical address conversion, make use of the fact that dma_alloc_coherent() can already do that for us. Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx> --- drivers/usb/gadget/fsl_udc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c index 705f6c0ba..a47ba20f4 100644 --- a/drivers/usb/gadget/fsl_udc.c +++ b/drivers/usb/gadget/fsl_udc.c @@ -1143,11 +1143,10 @@ static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length, (unsigned)EP_MAX_LENGTH_TRANSFER); dtd = dma_alloc_coherent(sizeof(struct ep_td_struct), - DMA_ADDRESS_BROKEN); + dma); if (dtd == NULL) return dtd; - *dma = (dma_addr_t)virt_to_phys(dtd); dtd->td_dma = *dma; /* Clear reserved field */ swap_temp = cpu_to_le32(dtd->size_ioc_sts); @@ -2066,13 +2065,12 @@ static int struct_udc_setup(struct fsl_udc *udc, size &= ~(QH_ALIGNMENT - 1); } - udc->ep_qh = dma_alloc_coherent(size, DMA_ADDRESS_BROKEN); + udc->ep_qh = dma_alloc_coherent(size, &udc->ep_qh_dma); if (!udc->ep_qh) { ERR("malloc QHs for udc failed\n"); kfree(udc->eps); return -1; } - udc->ep_qh_dma = (dma_addr_t)virt_to_phys(udc->ep_qh); udc->ep_qh_size = size; -- 2.21.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox