]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/sgiioc4.c
ide: move ide_map_sg() call out of ->dma_setup method (take 2)
[linux-2.6-omap-h63xx.git] / drivers / ide / sgiioc4.c
index 457a762a1f29d1f2f11480eb999e07421bc45458..d90e8c5af0a231a7a4ff36ee1a5f3a64852d850c 100644 (file)
@@ -442,7 +442,7 @@ static int sgiioc4_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
                                printk(KERN_WARNING
                                       "%s: DMA table too small\n",
                                       drive->name);
-                               goto use_pio_instead;
+                               return 0;
                        } else {
                                u32 bcount =
                                    0x10000 - (cur_addr & 0xffff);
@@ -477,9 +477,6 @@ static int sgiioc4_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
                return count;
        }
 
-use_pio_instead:
-       ide_destroy_dmatable(drive);
-
        return 0;               /* revert to PIO for this request */
 }
 
@@ -488,11 +485,9 @@ static int sgiioc4_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
        int ddir;
        u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE);
 
-       if (sgiioc4_build_dmatable(drive, cmd) == 0) {
+       if (sgiioc4_build_dmatable(drive, cmd) == 0)
                /* try PIO instead of DMA */
-               ide_map_sg(drive, cmd);
                return 1;
-       }
 
        if (write)
                /* Writes TO the IOC4 FROM Main Memory */