]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-lib.c
ide-cd: remove the internal 64k buffer
[linux-2.6] / drivers / ide / ide-lib.c
index 9b44fbdfe41fc503d085b6a0f08c1d3a9775d8fe..fa4c194b5ede14b89cdfa26bb52f8159f52c9933 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-/*
- *     IDE library routines. These are plug in code that most 
- *     drivers can use but occasionally may be weird enough
- *     to want to do their own thing with
- *
- *     Add common non I/O op stuff here. Make sure it has proper
- *     kernel-doc function headers or your patch will be rejected
- */
-
 static const char *udma_str[] =
         { "UDMA/16", "UDMA/25",  "UDMA/33",  "UDMA/44",
           "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
@@ -131,7 +122,6 @@ static struct ide_pio_info {
        const char      *name;
        int             pio;
 } ide_pio_blacklist [] = {
-/*     { "Conner Peripherals 1275MB - CFS1275A", 4 }, */
        { "Conner Peripherals 540MB - CFS540A", 3 },
 
        { "WDC AC2700",  3 },
@@ -147,10 +137,8 @@ static struct ide_pio_info {
        { "WDC AC1170",  1 },
        { "WDC AC1210",  1 },
        { "WDC AC280",   0 },
-/*     { "WDC AC21000", 4 }, */
        { "WDC AC31000", 3 },
        { "WDC AC31200", 3 },
-/*     { "WDC AC31600", 4 }, */
 
        { "Maxtor 7131 AT", 1 },
        { "Maxtor 7171 AT", 1 },
@@ -164,13 +152,6 @@ static struct ide_pio_info {
        { "SAMSUNG SHD-3122A", 1 },
        { "SAMSUNG SHD-3172A", 1 },
 
-/*     { "ST51080A", 4 },
- *     { "ST51270A", 4 },
- *     { "ST31220A", 4 },
- *     { "ST31640A", 4 },
- *     { "ST32140A", 4 },
- *     { "ST3780A",  4 },
- */
        { "ST5660A",  3 },
        { "ST3660A",  3 },
        { "ST3630A",  3 },
@@ -293,16 +274,6 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
                if (overridden)
                        printk(KERN_INFO "%s: tPIO > 2, assuming tPIO = 2\n",
                                         drive->name);
-
-               /*
-                * Conservative "downgrade" for all pre-ATA2 drives
-                */
-               if ((drive->hwif->host_flags & IDE_HFLAG_PIO_NO_DOWNGRADE) == 0 &&
-                   pio_mode && pio_mode < 4) {
-                       pio_mode--;
-                       printk(KERN_INFO "%s: applying conservative "
-                                        "PIO \"downgrade\"\n", drive->name);
-               }
        }
 
        if (pio_mode > max_mode)
@@ -358,8 +329,10 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
        if (!PCI_DMA_BUS_IS_PHYS) {
                addr = BLK_BOUNCE_ANY;
        } else if (on && drive->media == ide_disk) {
-               if (HWIF(drive)->pci_dev)
-                       addr = HWIF(drive)->pci_dev->dma_mask;
+               struct device *dev = drive->hwif->dev;
+
+               if (dev && dev->dma_mask)
+                       addr = *dev->dma_mask;
        }
 
        if (drive->queue)
@@ -576,7 +549,7 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat)
        }
        printk("}\n");
        if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
-               err = drive->hwif->INB(IDE_ERROR_REG);
+               err = ide_read_error(drive);
                printk("%s: %s: error=0x%02x ", drive->name, msg, err);
                if (drive->media == ide_disk)
                        ide_dump_ata_error(drive, err);