]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ppc/pmac.c
pmac: remove needless pmac_ide_destroy_dmatable() wrapper
[linux-2.6-omap-h63xx.git] / drivers / ide / ppc / pmac.c
index 5b083700d882d5fa39b008270345ebf4723ba16b..2e19d6298536f2fb94d3e0a8a1b5fd08877f3734 100644 (file)
@@ -430,9 +430,6 @@ pmac_ide_selectproc(ide_drive_t *drive)
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
 
-       if (pmif == NULL)
-               return;
-
        if (drive->dn & 1)
                writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG));
        else
@@ -452,9 +449,6 @@ pmac_ide_kauai_selectproc(ide_drive_t *drive)
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
 
-       if (pmif == NULL)
-               return;
-
        if (drive->dn & 1) {
                writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG));
                writel(pmif->timings[3], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG));
@@ -475,9 +469,6 @@ pmac_ide_do_update_timings(ide_drive_t *drive)
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
 
-       if (pmif == NULL)
-               return;
-
        if (pmif->kind == controller_sh_ata6 ||
            pmif->kind == controller_un_ata6 ||
            pmif->kind == controller_k2_ata6)
@@ -524,9 +515,6 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
        unsigned accessTime, recTime;
        unsigned int cycle_time;
 
-       if (pmif == NULL)
-               return;
-               
        /* which drive is it ? */
        timings = &pmif->timings[drive->dn & 1];
        t = *timings;
@@ -1535,18 +1523,6 @@ use_pio_instead:
        return 0; /* revert to PIO for this request */
 }
 
-/* Teardown mappings after DMA has completed.  */
-static void
-pmac_ide_destroy_dmatable (ide_drive_t *drive)
-{
-       ide_hwif_t *hwif = drive->hwif;
-
-       if (hwif->sg_nents) {
-               ide_destroy_dmatable(drive);
-               hwif->sg_nents = 0;
-       }
-}
-
 /*
  * Prepare a DMA transfer. We build the DMA table, adjust the timings for
  * a read on KeyLargo ATA/66 and mark us as waiting for DMA completion
@@ -1558,11 +1534,7 @@ pmac_ide_dma_setup(ide_drive_t *drive)
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
        struct request *rq = HWGROUP(drive)->rq;
-       u8 unit = drive->dn & 1, ata4;
-
-       if (pmif == NULL)
-               return 1;
-       ata4 = (pmif->kind == controller_kl_ata4);      
+       u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4);
 
        if (!pmac_ide_build_dmatable(drive, rq)) {
                ide_map_sg(drive, rq);
@@ -1616,17 +1588,15 @@ pmac_ide_dma_end (ide_drive_t *drive)
        ide_hwif_t *hwif = drive->hwif;
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
-       volatile struct dbdma_regs __iomem *dma;
+       volatile struct dbdma_regs __iomem *dma = pmif->dma_regs;
        u32 dstat;
-       
-       if (pmif == NULL)
-               return 0;
-       dma = pmif->dma_regs;
 
        drive->waiting_for_dma = 0;
        dstat = readl(&dma->status);
        writel(((RUN|WAKE|DEAD) << 16), &dma->control);
-       pmac_ide_destroy_dmatable(drive);
+
+       ide_destroy_dmatable(drive);
+
        /* verify good dma status. we don't check for ACTIVE beeing 0. We should...
         * in theory, but with ATAPI decices doing buffer underruns, that would
         * cause us to disable DMA, which isn't what we want
@@ -1646,13 +1616,9 @@ pmac_ide_dma_test_irq (ide_drive_t *drive)
        ide_hwif_t *hwif = drive->hwif;
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
-       volatile struct dbdma_regs __iomem *dma;
+       volatile struct dbdma_regs __iomem *dma = pmif->dma_regs;
        unsigned long status, timeout;
 
-       if (pmif == NULL)
-               return 0;
-       dma = pmif->dma_regs;
-
        /* We have to things to deal with here:
         * 
         * - The dbdma won't stop if the command was started
@@ -1705,14 +1671,9 @@ pmac_ide_dma_lost_irq (ide_drive_t *drive)
        ide_hwif_t *hwif = drive->hwif;
        pmac_ide_hwif_t *pmif =
                (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
-       volatile struct dbdma_regs __iomem *dma;
-       unsigned long status;
-
-       if (pmif == NULL)
-               return;
-       dma = pmif->dma_regs;
+       volatile struct dbdma_regs __iomem *dma = pmif->dma_regs;
+       unsigned long status = readl(&dma->status);
 
-       status = readl(&dma->status);
        printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status);
 }