diff options
author | Felipe Balbi <balbi@ti.com> | 2013-01-28 10:08:28 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:16:58 -0400 |
commit | 0324f25fc66cd94273d0aa67637ed260ff70f01e (patch) | |
tree | e901c9baa0b0e36be75bcfce2ae0fcd97c820bef /drivers/usb/gadget/fusb300_udc.c | |
parent | 5f6da778578de6b7c43b943cf9cfba12289e9ff3 (diff) |
usb: gadget: fusb300: switch over to usb_gadget_map/unmap_request()
we have generic implementations for a reason,
let's use them
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/fusb300_udc.c')
-rw-r--r-- | drivers/usb/gadget/fusb300_udc.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index 2d3c8b351f42..5c9dd064767f 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c | |||
@@ -938,25 +938,22 @@ IDMA_RESET: | |||
938 | static void fusb300_set_idma(struct fusb300_ep *ep, | 938 | static void fusb300_set_idma(struct fusb300_ep *ep, |
939 | struct fusb300_request *req) | 939 | struct fusb300_request *req) |
940 | { | 940 | { |
941 | dma_addr_t d; | 941 | int ret; |
942 | 942 | ||
943 | d = dma_map_single(NULL, req->req.buf, req->req.length, DMA_TO_DEVICE); | 943 | ret = usb_gadget_map_request(&ep->fusb300->gadget, |
944 | 944 | &req->req, DMA_TO_DEVICE); | |
945 | if (dma_mapping_error(NULL, d)) { | 945 | if (ret) |
946 | printk(KERN_DEBUG "dma_mapping_error\n"); | ||
947 | return; | 946 | return; |
948 | } | ||
949 | |||
950 | dma_sync_single_for_device(NULL, d, req->req.length, DMA_TO_DEVICE); | ||
951 | 947 | ||
952 | fusb300_enable_bit(ep->fusb300, FUSB300_OFFSET_IGER0, | 948 | fusb300_enable_bit(ep->fusb300, FUSB300_OFFSET_IGER0, |
953 | FUSB300_IGER0_EEPn_PRD_INT(ep->epnum)); | 949 | FUSB300_IGER0_EEPn_PRD_INT(ep->epnum)); |
954 | 950 | ||
955 | fusb300_fill_idma_prdtbl(ep, d, req->req.length); | 951 | fusb300_fill_idma_prdtbl(ep, req->req.dma, req->req.length); |
956 | /* check idma is done */ | 952 | /* check idma is done */ |
957 | fusb300_wait_idma_finished(ep); | 953 | fusb300_wait_idma_finished(ep); |
958 | 954 | ||
959 | dma_unmap_single(NULL, d, req->req.length, DMA_TO_DEVICE); | 955 | usb_gadget_unmap_request(&ep->fusb300->gadget, |
956 | &req->req, DMA_TO_DEVICE); | ||
960 | } | 957 | } |
961 | 958 | ||
962 | static void in_ep_fifo_handler(struct fusb300_ep *ep) | 959 | static void in_ep_fifo_handler(struct fusb300_ep *ep) |