]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-lib.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-lib.c
index a3bd8e8ed6b04545fdde4454f440a4cc505e5853..7031a8dcf6921330ac890af8c23b36294793b08d 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 },
@@ -358,8 +339,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)
@@ -454,8 +437,7 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
 static void ide_dump_opcode(ide_drive_t *drive)
 {
        struct request *rq;
-       u8 opcode = 0;
-       int found = 0;
+       ide_task_t *task = NULL;
 
        spin_lock(&ide_lock);
        rq = NULL;
@@ -464,25 +446,15 @@ static void ide_dump_opcode(ide_drive_t *drive)
        spin_unlock(&ide_lock);
        if (!rq)
                return;
-       if (rq->cmd_type == REQ_TYPE_ATA_CMD) {
-               char *args = rq->buffer;
-               if (args) {
-                       opcode = args[0];
-                       found = 1;
-               }
-       } else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-               ide_task_t *args = rq->special;
-               if (args) {
-                       opcode = args->tf.command;
-                       found = 1;
-               }
-       }
+
+       if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE)
+               task = rq->special;
 
        printk("ide: failed opcode was: ");
-       if (!found)
-               printk("unknown\n");
+       if (task == NULL)
+               printk(KERN_CONT "unknown\n");
        else
-               printk("0x%02x\n", opcode);
+               printk(KERN_CONT "0x%02x\n", task->tf.command);
 }
 
 u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48)
@@ -587,7 +559,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);