diff options
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hcd.c | 8 | ||||
-rw-r--r-- | drivers/usb/core/message.c | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 0abc5c537f3..297c92e4bf8 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1278,7 +1278,7 @@ static void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; if (urb->transfer_flags & URB_DMA_MAP_SG) dma_unmap_sg(hcd->self.controller, - urb->sg->sg, + urb->sg, urb->num_sgs, dir); else if (urb->transfer_flags & URB_DMA_MAP_PAGE) @@ -1346,7 +1346,7 @@ static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, if (urb->num_sgs) { int n = dma_map_sg( hcd->self.controller, - urb->sg->sg, + urb->sg, urb->num_sgs, dir); if (n <= 0) @@ -1359,9 +1359,7 @@ static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, URB_DMA_SG_COMBINED; } } else if (urb->sg) { - struct scatterlist *sg; - - sg = (struct scatterlist *) urb->sg; + struct scatterlist *sg = urb->sg; urb->transfer_dma = dma_map_page( hcd->self.controller, sg_page(sg), diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index d8329eb47d4..63919b8abee 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -413,7 +413,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, sg->length; } } - io->urbs[0]->sg = io; + io->urbs[0]->sg = sg; io->urbs[0]->num_sgs = io->entries; io->entries = 1; } else { @@ -454,7 +454,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, } io->urbs[i]->transfer_buffer_length = len; - io->urbs[i]->sg = (struct usb_sg_request *) sg; + io->urbs[i]->sg = sg; } io->urbs[--i]->transfer_flags &= ~URB_NO_INTERRUPT; } |