diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/core/hcd.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/imx21-hcd.c | 5 | ||||
-rw-r--r-- | drivers/usb/musb/musb_host.c | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 6a95017fa62b..335c1ddb260d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1262,7 +1262,7 @@ static void hcd_free_coherent(struct usb_bus *bus, dma_addr_t *dma_handle, | |||
1262 | *dma_handle = 0; | 1262 | *dma_handle = 0; |
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | void unmap_urb_setup_for_dma(struct usb_hcd *hcd, struct urb *urb) | 1265 | void usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *hcd, struct urb *urb) |
1266 | { | 1266 | { |
1267 | if (urb->transfer_flags & URB_SETUP_MAP_SINGLE) | 1267 | if (urb->transfer_flags & URB_SETUP_MAP_SINGLE) |
1268 | dma_unmap_single(hcd->self.controller, | 1268 | dma_unmap_single(hcd->self.controller, |
@@ -1279,13 +1279,13 @@ void unmap_urb_setup_for_dma(struct usb_hcd *hcd, struct urb *urb) | |||
1279 | /* Make it safe to call this routine more than once */ | 1279 | /* Make it safe to call this routine more than once */ |
1280 | urb->transfer_flags &= ~(URB_SETUP_MAP_SINGLE | URB_SETUP_MAP_LOCAL); | 1280 | urb->transfer_flags &= ~(URB_SETUP_MAP_SINGLE | URB_SETUP_MAP_LOCAL); |
1281 | } | 1281 | } |
1282 | EXPORT_SYMBOL_GPL(unmap_urb_setup_for_dma); | 1282 | EXPORT_SYMBOL_GPL(usb_hcd_unmap_urb_setup_for_dma); |
1283 | 1283 | ||
1284 | void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) | 1284 | void usb_hcd_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) |
1285 | { | 1285 | { |
1286 | enum dma_data_direction dir; | 1286 | enum dma_data_direction dir; |
1287 | 1287 | ||
1288 | unmap_urb_setup_for_dma(hcd, urb); | 1288 | usb_hcd_unmap_urb_setup_for_dma(hcd, urb); |
1289 | 1289 | ||
1290 | dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; | 1290 | dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; |
1291 | if (urb->transfer_flags & URB_DMA_MAP_SG) | 1291 | if (urb->transfer_flags & URB_DMA_MAP_SG) |
@@ -1314,7 +1314,7 @@ void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) | |||
1314 | urb->transfer_flags &= ~(URB_DMA_MAP_SG | URB_DMA_MAP_PAGE | | 1314 | urb->transfer_flags &= ~(URB_DMA_MAP_SG | URB_DMA_MAP_PAGE | |
1315 | URB_DMA_MAP_SINGLE | URB_MAP_LOCAL); | 1315 | URB_DMA_MAP_SINGLE | URB_MAP_LOCAL); |
1316 | } | 1316 | } |
1317 | EXPORT_SYMBOL_GPL(unmap_urb_for_dma); | 1317 | EXPORT_SYMBOL_GPL(usb_hcd_unmap_urb_for_dma); |
1318 | 1318 | ||
1319 | static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, | 1319 | static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, |
1320 | gfp_t mem_flags) | 1320 | gfp_t mem_flags) |
@@ -1410,7 +1410,7 @@ static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, | |||
1410 | } | 1410 | } |
1411 | if (ret && (urb->transfer_flags & (URB_SETUP_MAP_SINGLE | | 1411 | if (ret && (urb->transfer_flags & (URB_SETUP_MAP_SINGLE | |
1412 | URB_SETUP_MAP_LOCAL))) | 1412 | URB_SETUP_MAP_LOCAL))) |
1413 | unmap_urb_for_dma(hcd, urb); | 1413 | usb_hcd_unmap_urb_for_dma(hcd, urb); |
1414 | } | 1414 | } |
1415 | return ret; | 1415 | return ret; |
1416 | } | 1416 | } |
@@ -1451,7 +1451,7 @@ int usb_hcd_submit_urb (struct urb *urb, gfp_t mem_flags) | |||
1451 | if (likely(status == 0)) { | 1451 | if (likely(status == 0)) { |
1452 | status = hcd->driver->urb_enqueue(hcd, urb, mem_flags); | 1452 | status = hcd->driver->urb_enqueue(hcd, urb, mem_flags); |
1453 | if (unlikely(status)) | 1453 | if (unlikely(status)) |
1454 | unmap_urb_for_dma(hcd, urb); | 1454 | usb_hcd_unmap_urb_for_dma(hcd, urb); |
1455 | } | 1455 | } |
1456 | } | 1456 | } |
1457 | 1457 | ||
@@ -1557,7 +1557,7 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status) | |||
1557 | !status)) | 1557 | !status)) |
1558 | status = -EREMOTEIO; | 1558 | status = -EREMOTEIO; |
1559 | 1559 | ||
1560 | unmap_urb_for_dma(hcd, urb); | 1560 | usb_hcd_unmap_urb_for_dma(hcd, urb); |
1561 | usbmon_urb_complete(&hcd->self, urb, status); | 1561 | usbmon_urb_complete(&hcd->self, urb, status); |
1562 | usb_unanchor_urb(urb); | 1562 | usb_unanchor_urb(urb); |
1563 | 1563 | ||
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c index f90d003f2302..b7dfda8a1d51 100644 --- a/drivers/usb/host/imx21-hcd.c +++ b/drivers/usb/host/imx21-hcd.c | |||
@@ -927,7 +927,8 @@ static void schedule_nonisoc_etd(struct imx21 *imx21, struct urb *urb) | |||
927 | if (state == US_CTRL_SETUP) { | 927 | if (state == US_CTRL_SETUP) { |
928 | dir = TD_DIR_SETUP; | 928 | dir = TD_DIR_SETUP; |
929 | if (unsuitable_for_dma(urb->setup_dma)) | 929 | if (unsuitable_for_dma(urb->setup_dma)) |
930 | unmap_urb_setup_for_dma(imx21->hcd, urb); | 930 | usb_hcd_unmap_urb_setup_for_dma(imx21->hcd, |
931 | urb); | ||
931 | etd->dma_handle = urb->setup_dma; | 932 | etd->dma_handle = urb->setup_dma; |
932 | etd->cpu_buffer = urb->setup_packet; | 933 | etd->cpu_buffer = urb->setup_packet; |
933 | bufround = 0; | 934 | bufround = 0; |
@@ -943,7 +944,7 @@ static void schedule_nonisoc_etd(struct imx21 *imx21, struct urb *urb) | |||
943 | dir = usb_pipeout(pipe) ? TD_DIR_OUT : TD_DIR_IN; | 944 | dir = usb_pipeout(pipe) ? TD_DIR_OUT : TD_DIR_IN; |
944 | bufround = (dir == TD_DIR_IN) ? 1 : 0; | 945 | bufround = (dir == TD_DIR_IN) ? 1 : 0; |
945 | if (unsuitable_for_dma(urb->transfer_dma)) | 946 | if (unsuitable_for_dma(urb->transfer_dma)) |
946 | unmap_urb_for_dma(imx21->hcd, urb); | 947 | usb_hcd_unmap_urb_for_dma(imx21->hcd, urb); |
947 | 948 | ||
948 | etd->dma_handle = urb->transfer_dma; | 949 | etd->dma_handle = urb->transfer_dma; |
949 | etd->cpu_buffer = urb->transfer_buffer; | 950 | etd->cpu_buffer = urb->transfer_buffer; |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 4d5bcb4e14d2..4d2f3f79c425 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -1336,7 +1336,7 @@ void musb_host_tx(struct musb *musb, u8 epnum) | |||
1336 | if (length > qh->maxpacket) | 1336 | if (length > qh->maxpacket) |
1337 | length = qh->maxpacket; | 1337 | length = qh->maxpacket; |
1338 | /* Unmap the buffer so that CPU can use it */ | 1338 | /* Unmap the buffer so that CPU can use it */ |
1339 | unmap_urb_for_dma(musb_to_hcd(musb), urb); | 1339 | usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb); |
1340 | musb_write_fifo(hw_ep, length, urb->transfer_buffer + offset); | 1340 | musb_write_fifo(hw_ep, length, urb->transfer_buffer + offset); |
1341 | qh->segsize = length; | 1341 | qh->segsize = length; |
1342 | 1342 | ||
@@ -1758,7 +1758,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1758 | 1758 | ||
1759 | if (!dma) { | 1759 | if (!dma) { |
1760 | /* Unmap the buffer so that CPU can use it */ | 1760 | /* Unmap the buffer so that CPU can use it */ |
1761 | unmap_urb_for_dma(musb_to_hcd(musb), urb); | 1761 | usb_hcd_unmap_urb_for_dma(musb_to_hcd(musb), urb); |
1762 | done = musb_host_packet_rx(musb, urb, | 1762 | done = musb_host_packet_rx(musb, urb, |
1763 | epnum, iso_err); | 1763 | epnum, iso_err); |
1764 | DBG(6, "read %spacket\n", done ? "last " : ""); | 1764 | DBG(6, "read %spacket\n", done ? "last " : ""); |