Hi,
On Fri, Nov 12, 2010 at 07:55:30AM -0600, Kalliguddi, Hema wrote:
@@ -1128,28 +1186,11 @@ static int musb_gadget_queue(struct usb_
request->epnum = musb_ep->current_epnum;
request->tx = musb_ep->is_in;
- if (is_dma_capable() && musb_ep->dma) {
- if (request->request.dma == DMA_ADDR_INVALID) {
- request->request.dma = dma_map_single(
- musb->controller,
- request->request.buf,
- request->request.length,
- request->tx
- ? DMA_TO_DEVICE
- : DMA_FROM_DEVICE);
- request->mapped = 1;
- } else {
- dma_sync_single_for_device(musb->controller,
- request->request.dma,
- request->request.length,
- request->tx
- ? DMA_TO_DEVICE
- : DMA_FROM_DEVICE);
- request->mapped = 0;
- }
- } else if (!req->buf) {
+ if (is_dma_capable() && musb_ep->dma)
+ map_dma_buffer(request, musb);
+ else if (!req->buf)
return -ENODATA;
this little branch doesn't exist anymore. It was removed by below
commit:
commit 07397021058b7db468b67f8c41ce29ef6331ab92
Author: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
Date: Fri Sep 24 13:44:11 2010 +0300
usb: musb: gadget: kill duplicate code in musb_gadget_queue()
musb_gadget_queue() checks for '!req->buf' condition twice:
in the second case the code is both duplicated and unreachable
as the first check returns early.
Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
Signed-off-by: Felipe Balbi <balbi@xxxxxx>
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index f37b859..36cfd06 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1169,8 +1169,6 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
: DMA_FROM_DEVICE);
request->mapped = 0;
}
- } else if (!req->buf) {
- return -ENODATA;
} else
request->mapped = 0;
would you, please, rebase just to remove that little hunk ?
--
balbi
--
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