aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
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/ide
parent78c2f0b8c285c5305b3e67b0595200541e15eb43 (diff)
[SG] Update drivers to use sg helpers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/cris/ide-cris.c4
-rw-r--r--drivers/ide/ide-probe.c4
-rw-r--r--drivers/ide/ide-taskfile.c2
-rw-r--r--drivers/ide/mips/au1xxx-ide.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index ff20377b4c82..e196aefa2070 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -935,11 +935,11 @@ static int cris_ide_build_dmatable (ide_drive_t *drive)
935 * than two possibly non-adjacent physical 4kB pages. 935 * than two possibly non-adjacent physical 4kB pages.
936 */ 936 */
937 /* group sequential buffers into one large buffer */ 937 /* group sequential buffers into one large buffer */
938 addr = page_to_phys(sg->page) + sg->offset; 938 addr = sg_phys(sg);
939 size = sg_dma_len(sg); 939 size = sg_dma_len(sg);
940 while (--i) { 940 while (--i) {
941 sg = sg_next(sg); 941 sg = sg_next(sg);
942 if ((addr + size) != page_to_phys(sg->page) + sg->offset) 942 if ((addr + size) != sg_phys(sg))
943 break; 943 break;
944 size += sg_dma_len(sg); 944 size += sg_dma_len(sg);
945 } 945 }
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index d5146c57e5b3..ec55a173c08a 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1317,12 +1317,14 @@ static int hwif_init(ide_hwif_t *hwif)
1317 if (!hwif->sg_max_nents) 1317 if (!hwif->sg_max_nents)
1318 hwif->sg_max_nents = PRD_ENTRIES; 1318 hwif->sg_max_nents = PRD_ENTRIES;
1319 1319
1320 hwif->sg_table = kzalloc(sizeof(struct scatterlist)*hwif->sg_max_nents, 1320 hwif->sg_table = kmalloc(sizeof(struct scatterlist)*hwif->sg_max_nents,
1321 GFP_KERNEL); 1321 GFP_KERNEL);
1322 if (!hwif->sg_table) { 1322 if (!hwif->sg_table) {
1323 printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name); 1323 printk(KERN_ERR "%s: unable to allocate SG table.\n", hwif->name);
1324 goto out; 1324 goto out;
1325 } 1325 }
1326
1327 sg_init_table(hwif->sg_table, hwif->sg_max_nents);
1326 1328
1327 if (init_irq(hwif) == 0) 1329 if (init_irq(hwif) == 0)
1328 goto done; 1330 goto done;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 73ef6bf5fbcc..d066546f2831 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -261,7 +261,7 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write)
261 hwif->cursg = sg; 261 hwif->cursg = sg;
262 } 262 }
263 263
264 page = cursg->page; 264 page = sg_page(cursg);
265 offset = cursg->offset + hwif->cursg_ofs * SECTOR_SIZE; 265 offset = cursg->offset + hwif->cursg_ofs * SECTOR_SIZE;
266 266
267 /* get the current page and offset */ 267 /* get the current page and offset */
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 1de58566e5b6..a4ce3ba15d61 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -276,8 +276,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
276 276
277 if (iswrite) { 277 if (iswrite) {
278 if(!put_source_flags(ahwif->tx_chan, 278 if(!put_source_flags(ahwif->tx_chan,
279 (void*)(page_address(sg->page) 279 (void*) sg_virt(sg),
280 + sg->offset),
281 tc, flags)) { 280 tc, flags)) {
282 printk(KERN_ERR "%s failed %d\n", 281 printk(KERN_ERR "%s failed %d\n",
283 __FUNCTION__, __LINE__); 282 __FUNCTION__, __LINE__);
@@ -285,8 +284,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
285 } else 284 } else
286 { 285 {
287 if(!put_dest_flags(ahwif->rx_chan, 286 if(!put_dest_flags(ahwif->rx_chan,
288 (void*)(page_address(sg->page) 287 (void*) sg_virt(sg),
289 + sg->offset),
290 tc, flags)) { 288 tc, flags)) {
291 printk(KERN_ERR "%s failed %d\n", 289 printk(KERN_ERR "%s failed %d\n",
292 __FUNCTION__, __LINE__); 290 __FUNCTION__, __LINE__);