Commit 6e14119e authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] remove ide_dma_{good,bad}_drive from ide_hwif_t

Use __ide_dma_{good,bad}_drive() directly and remove these wrappers.
parent 1e99d97a
......@@ -413,7 +413,7 @@ static int config_drive_for_dma (ide_drive_t *drive)
if ((id->capability & 1) && hwif->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
return hwif->ide_dma_off(drive);
/*
......@@ -432,7 +432,7 @@ static int config_drive_for_dma (ide_drive_t *drive)
return hwif->ide_dma_on(drive);
/* Consult the list of known "good" drives */
if (hwif->ide_dma_good_drive(drive))
if (__ide_dma_good_drive(drive))
return hwif->ide_dma_on(drive);
}
// if (hwif->tuneproc != NULL) hwif->tuneproc(drive, 255);
......@@ -1084,10 +1084,6 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
hwif->ide_dma_end = &__ide_dma_end;
if (!hwif->ide_dma_test_irq)
hwif->ide_dma_test_irq = &__ide_dma_test_irq;
if (!hwif->ide_dma_bad_drive)
hwif->ide_dma_bad_drive = &__ide_dma_bad_drive;
if (!hwif->ide_dma_good_drive)
hwif->ide_dma_good_drive = &__ide_dma_good_drive;
if (!hwif->ide_dma_verbose)
hwif->ide_dma_verbose = &__ide_dma_verbose;
if (!hwif->ide_dma_timeout)
......
......@@ -844,8 +844,6 @@ void ide_unregister (unsigned int index)
hwif->ide_dma_test_irq = old_hwif.ide_dma_test_irq;
hwif->ide_dma_host_on = old_hwif.ide_dma_host_on;
hwif->ide_dma_host_off = old_hwif.ide_dma_host_off;
hwif->ide_dma_bad_drive = old_hwif.ide_dma_bad_drive;
hwif->ide_dma_good_drive = old_hwif.ide_dma_good_drive;
hwif->ide_dma_count = old_hwif.ide_dma_count;
hwif->ide_dma_verbose = old_hwif.ide_dma_verbose;
hwif->ide_dma_lostirq = old_hwif.ide_dma_lostirq;
......
......@@ -330,7 +330,7 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
if ((id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -347,7 +347,7 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -516,7 +516,7 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto ata_pio;
if ((id->field_valid & 4) && (m5229_revision >= 0xC2)) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -533,7 +533,7 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -459,7 +459,7 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if ((id->field_valid & 4) && cmd64x_ratemask(drive)) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -476,7 +476,7 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -180,7 +180,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
if (mate->present) {
struct hd_driveid *mateid = mate->id;
if (mateid && (mateid->capability & 1) &&
!hwif->ide_dma_bad_drive(mate)) {
!__ide_dma_bad_drive(mate)) {
if ((mateid->field_valid & 4) &&
(mateid->dma_ultra & 7))
udma_ok = 1;
......@@ -197,7 +197,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
* selecting UDMA only if the mate said it was ok.
*/
if (id && (id->capability & 1) && drive->autodma &&
!hwif->ide_dma_bad_drive(drive)) {
!__ide_dma_bad_drive(drive)) {
if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) {
if (id->dma_ultra & 4)
mode = XFER_UDMA_2;
......
......@@ -190,7 +190,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -207,7 +207,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -514,7 +514,7 @@ static int hpt366_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -530,7 +530,7 @@ static int hpt366_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -202,7 +202,7 @@ static int it8172_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -219,7 +219,7 @@ static int it8172_config_drive_xfer_rate (ide_drive_t *drive)
if (!it8172_config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!it8172_config_chipset_for_dma(drive))
......
......@@ -393,7 +393,7 @@ static int pdcnew_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -410,7 +410,7 @@ static int pdcnew_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
goto no_dma_set;
/* Consult the list of known "good" drives */
......
......@@ -482,7 +482,7 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -499,7 +499,7 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
goto no_dma_set;
/* Consult the list of known "good" drives */
......
......@@ -563,7 +563,7 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive)
if ((id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -580,7 +580,7 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive)
if (!piix_config_drive_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!piix_config_drive_for_dma(drive))
......
......@@ -164,7 +164,7 @@ static int sc1200_autoselect_dma_mode (ide_drive_t *drive)
*/
if (mate->present) {
struct hd_driveid *mateid = mate->id;
if (mateid && (mateid->capability & 1) && !hwif->ide_dma_bad_drive(mate)) {
if (mateid && (mateid->capability & 1) && !__ide_dma_bad_drive(mate)) {
if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7))
udma_ok = 1;
else if ((mateid->field_valid & 2) && (mateid->dma_mword & 7))
......@@ -177,7 +177,7 @@ static int sc1200_autoselect_dma_mode (ide_drive_t *drive)
* Now see what the current drive is capable of,
* selecting UDMA only if the mate said it was ok.
*/
if (id && (id->capability & 1) && hwif->autodma && !hwif->ide_dma_bad_drive(drive)) {
if (id && (id->capability & 1) && hwif->autodma && !__ide_dma_bad_drive(drive)) {
if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) {
if (id->dma_ultra & 4)
mode = XFER_UDMA_2;
......@@ -493,7 +493,7 @@ printk("%s: SC1200: resume\n", hwif->name);
//
for (d = 0; d < MAX_DRIVES; ++d) {
ide_drive_t *drive = &(hwif->drives[d]);
if (drive->present && !hwif->ide_dma_bad_drive(drive)) {
if (drive->present && !__ide_dma_bad_drive(drive)) {
int was_using_dma = drive->using_dma;
hwif->ide_dma_off_quietly(drive);
sc1200_config_dma(drive);
......
......@@ -464,7 +464,7 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
if ((id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -481,7 +481,7 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -649,8 +649,6 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq;
hwif->ide_dma_host_on = &sgiioc4_ide_dma_host_on;
hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off;
hwif->ide_dma_bad_drive = &__ide_dma_bad_drive;
hwif->ide_dma_good_drive = &__ide_dma_good_drive;
hwif->ide_dma_count = &__ide_dma_count;
hwif->ide_dma_verbose = &sgiioc4_ide_dma_verbose;
hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
......
......@@ -490,7 +490,7 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
if ((id->capability & 1) != 0 && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if ((id->field_valid & 4) && siimage_ratemask(drive)) {
......@@ -508,7 +508,7 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -671,7 +671,7 @@ static int sis5513_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
......@@ -688,7 +688,7 @@ static int sis5513_config_drive_xfer_rate (ide_drive_t *drive)
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
......
......@@ -158,7 +158,7 @@ static int sl82c105_check_drive (ide_drive_t *drive)
break;
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
break;
if (id->field_valid & 2) {
......@@ -167,7 +167,7 @@ static int sl82c105_check_drive (ide_drive_t *drive)
return hwif->ide_dma_on(drive);
}
if (hwif->ide_dma_good_drive(drive))
if (__ide_dma_good_drive(drive))
return hwif->ide_dma_on(drive);
} while (0);
......
......@@ -275,7 +275,7 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
......@@ -293,7 +293,7 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
if (!slc90e66_config_drive_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
} else if (__ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
/* Consult the list of known "good" drives */
if (!slc90e66_config_drive_for_dma(drive))
......
......@@ -173,7 +173,7 @@ static int triflex_config_drive_xfer_rate(ide_drive_t *drive)
struct hd_driveid *id = drive->id;
if (id && (id->capability & 1) && drive->autodma) {
if (hwif->ide_dma_bad_drive(drive))
if (__ide_dma_bad_drive(drive))
goto tune_pio;
if (id->field_valid & 2) {
if ((id->dma_mword & hwif->mwdma_mask) ||
......
......@@ -2171,8 +2171,6 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq;
hwif->ide_dma_host_off = &pmac_ide_dma_host_off;
hwif->ide_dma_host_on = &pmac_ide_dma_host_on;
hwif->ide_dma_good_drive = &__ide_dma_good_drive;
hwif->ide_dma_bad_drive = &__ide_dma_bad_drive;
hwif->ide_dma_verbose = &__ide_dma_verbose;
hwif->ide_dma_timeout = &__ide_dma_timeout;
hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
......
......@@ -795,8 +795,6 @@ typedef struct ide_dma_ops_s {
int (*ide_dma_test_irq)(ide_drive_t *drive);
int (*ide_dma_host_on)(ide_drive_t *drive);
int (*ide_dma_host_off)(ide_drive_t *drive);
int (*ide_dma_bad_drive)(ide_drive_t *drive);
int (*ide_dma_good_drive)(ide_drive_t *drive);
int (*ide_dma_count)(ide_drive_t *drive);
int (*ide_dma_verbose)(ide_drive_t *drive);
int (*ide_dma_lostirq)(ide_drive_t *drive);
......@@ -934,8 +932,6 @@ typedef struct hwif_s {
int (*ide_dma_test_irq)(ide_drive_t *drive);
int (*ide_dma_host_on)(ide_drive_t *drive);
int (*ide_dma_host_off)(ide_drive_t *drive);
int (*ide_dma_bad_drive)(ide_drive_t *drive);
int (*ide_dma_good_drive)(ide_drive_t *drive);
int (*ide_dma_count)(ide_drive_t *drive);
int (*ide_dma_verbose)(ide_drive_t *drive);
int (*ide_dma_lostirq)(ide_drive_t *drive);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment