ide: pass 'hwif *' instead of 'drive *' to ->OUTBSYNC method
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:49 +0000 (21:21 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 15 Jul 2008 19:21:49 +0000 (21:21 +0200)
There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-probe.c
drivers/ide/ide-taskfile.c
drivers/ide/pci/scc_pata.c
drivers/ide/ppc/pmac.c
drivers/scsi/ide-scsi.c
include/linux/ide.h

index 2083cc08b2ce96f74e96f804acc1f3d50e08a93f..c28fcdf0ee9e9ee3bd25d8d749fc9feb79739f6e 100644 (file)
@@ -437,7 +437,7 @@ static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, u
 
        if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT))
                /* force an abort */
-               hwif->OUTBSYNC(drive, WIN_IDLEIMMEDIATE,
+               hwif->OUTBSYNC(hwif, WIN_IDLEIMMEDIATE,
                               hwif->io_ports.command_addr);
 
        if (rq->errors >= ERROR_MAX) {
index 491980aab86645d8ef4dd4dc3670021bb896d58c..4c32cf0b623c60a08b672a00575c0e57a3a8eca0 100644 (file)
@@ -42,7 +42,7 @@ static void ide_outb (u8 val, unsigned long port)
        outb(val, port);
 }
 
-static void ide_outbsync (ide_drive_t *drive, u8 addr, unsigned long port)
+static void ide_outbsync(ide_hwif_t *hwif, u8 addr, unsigned long port)
 {
        outb(addr, port);
 }
@@ -68,7 +68,7 @@ static void ide_mm_outb (u8 value, unsigned long port)
        writeb(value, (void __iomem *) port);
 }
 
-static void ide_mm_outbsync (ide_drive_t *drive, u8 value, unsigned long port)
+static void ide_mm_outbsync(ide_hwif_t *hwif, u8 value, unsigned long port)
 {
        writeb(value, (void __iomem *) port);
 }
@@ -686,7 +686,7 @@ int ide_driveid_update(ide_drive_t *drive)
        SELECT_MASK(drive, 1);
        ide_set_irq(drive, 0);
        msleep(50);
-       hwif->OUTBSYNC(drive, WIN_IDENTIFY, hwif->io_ports.command_addr);
+       hwif->OUTBSYNC(hwif, WIN_IDENTIFY, hwif->io_ports.command_addr);
        timeout = jiffies + WAIT_WORSTCASE;
        do {
                if (time_after(jiffies, timeout)) {
@@ -773,7 +773,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
        ide_set_irq(drive, 0);
        hwif->OUTB(speed, io_ports->nsect_addr);
        hwif->OUTB(SETFEATURES_XFER, io_ports->feature_addr);
-       hwif->OUTBSYNC(drive, WIN_SETFEATURES, io_ports->command_addr);
+       hwif->OUTBSYNC(hwif, WIN_SETFEATURES, io_ports->command_addr);
        if (drive->quirk_list == 2)
                ide_set_irq(drive, 1);
 
@@ -881,7 +881,7 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
 
        spin_lock_irqsave(&ide_lock, flags);
        __ide_set_handler(drive, handler, timeout, expiry);
-       hwif->OUTBSYNC(drive, cmd, hwif->io_ports.command_addr);
+       hwif->OUTBSYNC(hwif, cmd, hwif->io_ports.command_addr);
        /*
         * Drive takes 400nS to respond, we must avoid the IRQ being
         * serviced before that.
@@ -899,7 +899,7 @@ void ide_execute_pkt_cmd(ide_drive_t *drive)
        unsigned long flags;
 
        spin_lock_irqsave(&ide_lock, flags);
-       hwif->OUTBSYNC(drive, WIN_PACKETCMD, hwif->io_ports.command_addr);
+       hwif->OUTBSYNC(hwif, WIN_PACKETCMD, hwif->io_ports.command_addr);
        ndelay(400);
        spin_unlock_irqrestore(&ide_lock, flags);
 }
@@ -1094,7 +1094,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
                pre_reset(drive);
                SELECT_DRIVE(drive);
                udelay (20);
-               hwif->OUTBSYNC(drive, WIN_SRST, io_ports->command_addr);
+               hwif->OUTBSYNC(hwif, WIN_SRST, io_ports->command_addr);
                ndelay(400);
                hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
                hwgroup->polling = 1;
@@ -1125,14 +1125,14 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
         * recover from reset very quickly, saving us the first 50ms wait time.
         */
        /* set SRST and nIEN */
-       hwif->OUTBSYNC(drive, drive->ctl|6, io_ports->ctl_addr);
+       hwif->OUTBSYNC(hwif, drive->ctl | 6, io_ports->ctl_addr);
        /* more than enough time */
        udelay(10);
        if (drive->quirk_list == 2)
                ctl = drive->ctl;       /* clear SRST and nIEN */
        else
                ctl = drive->ctl | 2;   /* clear SRST, leave nIEN */
-       hwif->OUTBSYNC(drive, ctl, io_ports->ctl_addr);
+       hwif->OUTBSYNC(hwif, ctl, io_ports->ctl_addr);
        /* more than enough time */
        udelay(10);
        hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
index 12513c45d7009653c8e2aa11d2d0fd3c7295cca9..b010633eb5ba847375cef8ddbe5d2b301afdaf3d 100644 (file)
@@ -293,7 +293,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
                hwif->OUTB(0, io_ports->feature_addr);
 
        /* ask drive for ID */
-       hwif->OUTBSYNC(drive, cmd, io_ports->command_addr);
+       hwif->OUTBSYNC(hwif, cmd, hwif->io_ports.command_addr);
 
        timeout = ((cmd == WIN_IDENTIFY) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2;
        timeout += jiffies;
@@ -480,7 +480,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
                        msleep(50);
                        SELECT_DRIVE(drive);
                        msleep(50);
-                       hwif->OUTBSYNC(drive, WIN_SRST, io_ports->command_addr);
+                       hwif->OUTBSYNC(hwif, WIN_SRST, io_ports->command_addr);
                        (void)ide_busy_sleep(hwif);
                        rc = try_to_identify(drive, cmd);
                }
@@ -516,7 +516,7 @@ static void enable_nest (ide_drive_t *drive)
        printk("%s: enabling %s -- ", hwif->name, drive->id->model);
        SELECT_DRIVE(drive);
        msleep(50);
-       hwif->OUTBSYNC(drive, EXABYTE_ENABLE_NEST, hwif->io_ports.command_addr);
+       hwif->OUTBSYNC(hwif, EXABYTE_ENABLE_NEST, hwif->io_ports.command_addr);
 
        if (ide_busy_sleep(hwif)) {
                printk(KERN_CONT "failed (timeout)\n");
index 6a17ab54f80152f4a81ca7411049f334e0f114af..cf55a48a7dd25e5e33f62f5d49da320174c37a30 100644 (file)
@@ -117,7 +117,7 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
        switch (task->data_phase) {
        case TASKFILE_MULTI_OUT:
        case TASKFILE_OUT:
-               hwif->OUTBSYNC(drive, tf->command, hwif->io_ports.command_addr);
+               hwif->OUTBSYNC(hwif, tf->command, hwif->io_ports.command_addr);
                ndelay(400);    /* FIXME */
                return pre_task_out_intr(drive, task->rq);
        case TASKFILE_MULTI_IN:
index 133053c7a480b55a58a1cef4dad67876cd5f04bb..32eb0877fce23bee6ac89ad01b475d4d177701b8 100644 (file)
@@ -148,11 +148,8 @@ static void scc_ide_outb(u8 addr, unsigned long port)
        out_be32((void*)port, addr);
 }
 
-static void
-scc_ide_outbsync(ide_drive_t * drive, u8 addr, unsigned long port)
+static void scc_ide_outbsync(ide_hwif_t *hwif, u8 addr, unsigned long port)
 {
-       ide_hwif_t *hwif = HWIF(drive);
-
        out_be32((void*)port, addr);
        eieio();
        in_be32((void*)(hwif->dma_base + 0x01c));
index ba2d58727964f2bfa6a527b683535035da2da3b1..dcb2c466bb979efd7977437a2a9dfb969d7274e2 100644 (file)
@@ -480,13 +480,13 @@ pmac_ide_do_update_timings(ide_drive_t *drive)
                pmac_ide_selectproc(drive);
 }
 
-static void
-pmac_outbsync(ide_drive_t *drive, u8 value, unsigned long port)
+static void pmac_outbsync(ide_hwif_t *hwif, u8 value, unsigned long port)
 {
        u32 tmp;
        
        writeb(value, (void __iomem *) port);
-       tmp = readl(PMAC_IDE_REG(IDE_TIMING_CONFIG));
+       tmp = readl((void __iomem *)(hwif->io_ports.data_addr
+                                    + IDE_TIMING_CONFIG));
 }
 
 /*
index 3222aa589dbf82105bc8d89b98bd36428395093a..d7fd5e550a2551bea3eaf2765af980f7ad53f8f0 100644 (file)
@@ -257,7 +257,7 @@ idescsi_atapi_error(ide_drive_t *drive, struct request *rq, u8 stat, u8 err)
 
        if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT))
                /* force an abort */
-               hwif->OUTBSYNC(drive, WIN_IDLEIMMEDIATE,
+               hwif->OUTBSYNC(hwif, WIN_IDLEIMMEDIATE,
                               hwif->io_ports.command_addr);
 
        rq->errors++;
index b01b102be4de42a92a0cf549983499dae9e376d3..1c343146964976eadc61211021b09be1afbae841 100644 (file)
@@ -493,7 +493,7 @@ typedef struct hwif_s {
        void (*ide_dma_clear_irq)(ide_drive_t *drive);
 
        void (*OUTB)(u8 addr, unsigned long port);
-       void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
+       void (*OUTBSYNC)(struct hwif_s *hwif, u8 addr, unsigned long port);
 
        u8  (*INB)(unsigned long port);