Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc
[safe/jmp/linux-2.6] / drivers / ide / icside.c
index cf0522f..36da913 100644 (file)
@@ -287,13 +287,8 @@ static int icside_dma_end(ide_drive_t *drive)
        ide_hwif_t *hwif = drive->hwif;
        struct expansion_card *ec = ECARD_DEV(hwif->dev);
 
-       drive->waiting_for_dma = 0;
-
        disable_dma(ec->dma);
 
-       /* Teardown mappings after DMA has completed. */
-       ide_destroy_dmatable(drive);
-
        return get_dma_residue(ec->dma) != 0;
 }
 
@@ -307,15 +302,14 @@ static void icside_dma_start(ide_drive_t *drive)
        enable_dma(ec->dma);
 }
 
-static int icside_dma_setup(ide_drive_t *drive)
+static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
 {
        ide_hwif_t *hwif = drive->hwif;
        struct expansion_card *ec = ECARD_DEV(hwif->dev);
        struct icside_state *state = ecard_get_drvdata(ec);
-       struct request *rq = hwif->rq;
        unsigned int dma_mode;
 
-       if (rq_data_dir(rq))
+       if (cmd->tf_flags & IDE_TFLAG_WRITE)
                dma_mode = DMA_MODE_WRITE;
        else
                dma_mode = DMA_MODE_READ;
@@ -325,12 +319,6 @@ static int icside_dma_setup(ide_drive_t *drive)
         */
        BUG_ON(dma_channel_active(ec->dma));
 
-       hwif->sg_nents = ide_build_sglist(drive, rq);
-       if (hwif->sg_nents == 0) {
-               ide_map_sg(drive, rq);
-               return 1;
-       }
-
        /*
         * Ensure that we have the right interrupt routed.
         */
@@ -350,20 +338,12 @@ static int icside_dma_setup(ide_drive_t *drive)
         * Tell the DMA engine about the SG table and
         * data direction.
         */
-       set_dma_sg(ec->dma, hwif->sg_table, hwif->sg_nents);
+       set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents);
        set_dma_mode(ec->dma, dma_mode);
 
-       drive->waiting_for_dma = 1;
-
        return 0;
 }
 
-static void icside_dma_exec_cmd(ide_drive_t *drive, u8 cmd)
-{
-       /* issue cmd to drive */
-       ide_execute_command(drive, cmd, ide_dma_intr, 2 * WAIT_CMD, NULL);
-}
-
 static int icside_dma_test_irq(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = drive->hwif;
@@ -387,11 +367,9 @@ static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
 static const struct ide_dma_ops icside_v6_dma_ops = {
        .dma_host_set           = icside_dma_host_set,
        .dma_setup              = icside_dma_setup,
-       .dma_exec_cmd           = icside_dma_exec_cmd,
        .dma_start              = icside_dma_start,
        .dma_end                = icside_dma_end,
        .dma_test_irq           = icside_dma_test_irq,
-       .dma_timeout            = ide_dma_timeout,
        .dma_lost_irq           = ide_dma_lost_irq,
 };
 #else
@@ -488,7 +466,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
        struct ide_host *host;
        unsigned int sel = 0;
        int ret;
-       hw_regs_t hw[2], *hws[] = { &hw[0], NULL, NULL, NULL };
+       hw_regs_t hw[2], *hws[] = { &hw[0], &hw[1], NULL, NULL };
        struct ide_port_info d = icside_v6_port_info;
 
        ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);