aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-22 15:19:53 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-22 15:19:53 -0400
commit45711f1af6eff1a6d010703b4862e0d2b9afd056 (patch)
tree3d0048f46e3df9d217d56127462ebe680348bd5a /drivers/usb
parent78c2f0b8c285c5305b3e67b0595200541e15eb43 (diff)
[SG] Update drivers to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/message.c6
-rw-r--r--drivers/usb/image/microtek.c5
-rw-r--r--drivers/usb/misc/usbtest.c4
-rw-r--r--drivers/usb/storage/protocol.c2
4 files changed, 7 insertions, 10 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 8dd5a6afd513..90d64a808464 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -437,13 +437,11 @@ int usb_sg_init (
437#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU) 437#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU)
438 io->urbs[i]->transfer_buffer = NULL; 438 io->urbs[i]->transfer_buffer = NULL;
439#else 439#else
440 io->urbs[i]->transfer_buffer = 440 io->urbs[i]->transfer_buffer = sg_virt(&sg[i]);
441 page_address(sg[i].page) + sg[i].offset;
442#endif 441#endif
443 } else { 442 } else {
444 /* hc may use _only_ transfer_buffer */ 443 /* hc may use _only_ transfer_buffer */
445 io->urbs [i]->transfer_buffer = 444 io->urbs [i]->transfer_buffer = sg_virt(&sg[i]);
446 page_address (sg [i].page) + sg [i].offset;
447 len = sg [i].length; 445 len = sg [i].length;
448 } 446 }
449 447
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index e7d982a71548..91e999c9f680 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -519,8 +519,7 @@ static void mts_do_sg (struct urb* transfer)
519 context->fragment++; 519 context->fragment++;
520 mts_int_submit_urb(transfer, 520 mts_int_submit_urb(transfer,
521 context->data_pipe, 521 context->data_pipe,
522 page_address(sg[context->fragment].page) + 522 sg_virt(&sg[context->fragment]),
523 sg[context->fragment].offset,
524 sg[context->fragment].length, 523 sg[context->fragment].length,
525 context->fragment + 1 == scsi_sg_count(context->srb) ? 524 context->fragment + 1 == scsi_sg_count(context->srb) ?
526 mts_data_done : mts_do_sg); 525 mts_data_done : mts_do_sg);
@@ -557,7 +556,7 @@ mts_build_transfer_context(struct scsi_cmnd *srb, struct mts_desc* desc)
557 return; 556 return;
558 } else { 557 } else {
559 sg = scsi_sglist(srb); 558 sg = scsi_sglist(srb);
560 desc->context.data = page_address(sg[0].page) + sg[0].offset; 559 desc->context.data = sg_virt(&sg[0]);
561 desc->context.data_length = sg[0].length; 560 desc->context.data_length = sg[0].length;
562 } 561 }
563 562
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index e901d31e051b..ea3162146481 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -360,9 +360,9 @@ static void free_sglist (struct scatterlist *sg, int nents)
360 if (!sg) 360 if (!sg)
361 return; 361 return;
362 for (i = 0; i < nents; i++) { 362 for (i = 0; i < nents; i++) {
363 if (!sg [i].page) 363 if (!sg_page(&sg[i]))
364 continue; 364 continue;
365 kfree (page_address (sg [i].page) + sg [i].offset); 365 kfree (sg_virt(&sg[i]));
366 } 366 }
367 kfree (sg); 367 kfree (sg);
368} 368}
diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
index cc8f7c52c729..889622baac20 100644
--- a/drivers/usb/storage/protocol.c
+++ b/drivers/usb/storage/protocol.c
@@ -195,7 +195,7 @@ unsigned int usb_stor_access_xfer_buf(unsigned char *buffer,
195 * the *offset and *index values for the next loop. */ 195 * the *offset and *index values for the next loop. */
196 cnt = 0; 196 cnt = 0;
197 while (cnt < buflen) { 197 while (cnt < buflen) {
198 struct page *page = sg->page + 198 struct page *page = sg_page(sg) +
199 ((sg->offset + *offset) >> PAGE_SHIFT); 199 ((sg->offset + *offset) >> PAGE_SHIFT);
200 unsigned int poff = 200 unsigned int poff =
201 (sg->offset + *offset) & (PAGE_SIZE-1); 201 (sg->offset + *offset) & (PAGE_SIZE-1);