[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1324290632-23758-8-git-send-email-balbi@ti.com>
Date: Mon, 19 Dec 2011 12:30:29 +0200
From: Felipe Balbi <balbi@...com>
To: Linux USB Mailing List <linux-usb@...r.kernel.org>
Cc: Felipe Balbi <balbi@...com>,
Greg Kroah-Hartman <gregkh@...e.de> (supporter:USB SUBSYSTEM
,commit_signer:28/50=56%),
Thomas Dahlmann <dahlmann.thomas@...or.de> (supporter:AMD GEODE
CS5536...),
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com> (commit_signer:43/50=86%),
linux-omap@...r.kernel.org (open list:DESIGNWARE USB3 D...),
linux-kernel@...r.kernel.org (open list),
linux-geode@...ts.infradead.org (open list:AMD GEODE CS5536...)
Subject: [PATCH 7/9] usb: gadget: net2272: use generic map/umap routines
those routines have everything we need to map/unmap
USB requests and it's better to use them.
Signed-off-by: Felipe Balbi <balbi@...com>
---
drivers/usb/gadget/net2272.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/gadget/net2272.c b/drivers/usb/gadget/net2272.c
index 4c81d54..db99d74 100644
--- a/drivers/usb/gadget/net2272.c
+++ b/drivers/usb/gadget/net2272.c
@@ -385,12 +385,9 @@ net2272_done(struct net2272_ep *ep, struct net2272_request *req, int status)
status = req->req.status;
dev = ep->dev;
- if (use_dma && req->mapped) {
- dma_unmap_single(dev->dev, req->req.dma, req->req.length,
- ep->is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
- req->req.dma = DMA_ADDR_INVALID;
- req->mapped = 0;
- }
+ if (use_dma)
+ usb_gadget_map_request(&dev->gadget, &req->req,
+ ep->is_in);
if (status && status != -ESHUTDOWN)
dev_vdbg(dev->dev, "complete %s req %p stat %d len %u/%u buf %p\n",
@@ -850,10 +847,11 @@ net2272_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
return -ESHUTDOWN;
/* set up dma mapping in case the caller didn't */
- if (use_dma && ep->dma && _req->dma == DMA_ADDR_INVALID) {
- _req->dma = dma_map_single(dev->dev, _req->buf, _req->length,
- ep->is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
- req->mapped = 1;
+ if (use_dma && ep->dma) {
+ status = usb_gadget_map_request(&dev->gadget, &req->req,
+ ep->is_in);
+ if (status)
+ return status;
}
dev_vdbg(dev->dev, "%s queue req %p, len %d buf %p dma %08llx %s\n",
--
1.7.8.rc3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists