instead of defining our own DMA_ADDR_INVALID mess, we can use dma_mapping_error() as a check for kicking or not DMA. This allows us to remove all references to DMA_ADDR_INVALID from MUSB driver. Signed-off-by: Felipe Balbi <balbi@xxxxxx> --- drivers/usb/musb/musb_dma.h | 2 -- drivers/usb/musb/musb_gadget.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h index 1b6b827..7371190 100644 --- a/drivers/usb/musb/musb_dma.h +++ b/drivers/usb/musb/musb_dma.h @@ -60,8 +60,6 @@ struct musb_hw_ep; * whether shared with the Inventra core or separate. */ -#define DMA_ADDR_INVALID (~(dma_addr_t)0) - #ifndef CONFIG_MUSB_PIO_ONLY #define is_dma_capable() (1) #else diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index ccc5872..c454375 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -250,7 +250,8 @@ static void txstate(struct musb *musb, struct musb_request *req) request_size = min_t(size_t, request->length - request->actual, musb_ep->dma->max_len); - use_dma = (request->dma != DMA_ADDR_INVALID && request_size); + use_dma = (!dma_mapping_error(&musb->g.dev, request->dma) + && request_size); /* MUSB_TXCSR_P_ISO is still set correctly */ @@ -1128,7 +1129,6 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) return NULL; } - request->request.dma = DMA_ADDR_INVALID; request->epnum = musb_ep->current_epnum; request->ep = musb_ep; -- 1.8.1.rc1.5.g7e0651a -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html