diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-04-08 11:43:30 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-04-08 11:43:30 +0200 |
commit | 529801898b24544f93532217ce18a7ebbb2b8c4f (patch) | |
tree | c51c8fd808e6cff15cabb1a9ac29be0661942384 /drivers/usb/musb/musb_gadget.c | |
parent | b847d0501afec4c7b12eb276aec10a2834f953ea (diff) | |
parent | 23995bbee01d75f09f72b1380bd6045a5b02947b (diff) |
Merge branch 'for-tip' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/core
Pull IBM zEnterprise EC12 support patchlet from Robert Richter.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/musb/musb_gadget.c')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index be18537c5f14..83eddedcd9be 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -141,7 +141,9 @@ static inline void map_dma_buffer(struct musb_request *request, static inline void unmap_dma_buffer(struct musb_request *request, struct musb *musb) { - if (!is_buffer_mapped(request)) + struct musb_ep *musb_ep = request->ep; + + if (!is_buffer_mapped(request) || !musb_ep->dma) return; if (request->request.dma == DMA_ADDR_INVALID) { @@ -195,7 +197,10 @@ __acquires(ep->musb->lock) ep->busy = 1; spin_unlock(&musb->lock); - unmap_dma_buffer(req, musb); + + if (!dma_mapping_error(&musb->g.dev, request->dma)) + unmap_dma_buffer(req, musb); + if (request->status == 0) dev_dbg(musb->controller, "%s done request %p, %d/%d\n", ep->end_point.name, request, |