]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide: set hwif->expiry prior to calling [__]ide_set_handler()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:46 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:46 +0000 (12:46 +0100)
* Set hwif->expiry prior to calling [__]ide_set_handler()
  and drop 'expiry' argument.

* Set hwif->expiry to NULL in ide_{timer_expiry,intr}()
  and remove 'hwif->expiry = NULL' assignments.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-atapi.c
drivers/ide/ide-cd.c
drivers/ide/ide-eh.c
drivers/ide/ide-io.c
drivers/ide/ide-iops.c
drivers/ide/ide-taskfile.c
include/linux/ide.h

index 75df05add1b961cef95d4b7e960e44296821926a..f1b1b71cb74caf4e27c32a42bf7a28989cfa7725 100644 (file)
@@ -483,7 +483,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
                  rq->cmd[0], bcount);
 next_irq:
        /* And set the interrupt handler again */
-       ide_set_handler(drive, ide_pc_intr, timeout, NULL);
+       ide_set_handler(drive, ide_pc_intr, timeout);
        return ide_started;
 }
 
@@ -602,11 +602,13 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
                }
        }
 
+       hwif->expiry = expiry;
+
        /* Set the interrupt routine */
        ide_set_handler(drive,
                        (dev_is_idecd(drive) ? drive->irq_handler
                                             : ide_pc_intr),
-                       timeout, expiry);
+                       timeout);
 
        /* Begin DMA, if necessary */
        if (dev_is_idecd(drive)) {
index a6c847d31b9d1fbe33bcd861d7514df28ea054ed..3f630e4080d42abec2711eb597ccf8ff17fc616d 100644 (file)
@@ -959,7 +959,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
                        expiry = ide_cd_expiry;
        }
 
-       ide_set_handler(drive, cdrom_newpc_intr, timeout, expiry);
+       hwif->expiry = expiry;
+       ide_set_handler(drive, cdrom_newpc_intr, timeout);
        return ide_started;
 
 end_request:
index aff1a9b045592dd98ffe8afd68342c2c28131088..11664976eea30cbde1f846cfcdde5147ed17c309 100644 (file)
@@ -175,8 +175,7 @@ static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive)
                printk(KERN_INFO "%s: ATAPI reset complete\n", drive->name);
        else {
                if (time_before(jiffies, hwif->poll_timeout)) {
-                       ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20,
-                                       NULL);
+                       ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20);
                        /* continue polling */
                        return ide_started;
                }
@@ -238,7 +237,7 @@ static ide_startstop_t reset_pollfunc(ide_drive_t *drive)
 
        if (!OK_STAT(tmp, 0, ATA_BUSY)) {
                if (time_before(jiffies, hwif->poll_timeout)) {
-                       ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
+                       ide_set_handler(drive, &reset_pollfunc, HZ/20);
                        /* continue polling */
                        return ide_started;
                }
@@ -355,7 +354,7 @@ static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
                ndelay(400);
                hwif->poll_timeout = jiffies + WAIT_WORSTCASE;
                hwif->polling = 1;
-               __ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL);
+               __ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20);
                spin_unlock_irqrestore(&hwif->lock, flags);
                return ide_started;
        }
@@ -415,7 +414,7 @@ static ide_startstop_t do_reset1(ide_drive_t *drive, int do_not_try_atapi)
        udelay(10);
        hwif->poll_timeout = jiffies + WAIT_WORSTCASE;
        hwif->polling = 1;
-       __ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL);
+       __ide_set_handler(drive, &reset_pollfunc, HZ/20);
 
        /*
         * Some weird controller like resetting themselves to a strange
index 47404f5526f1e8b99ba84f7a80cec625dcb63fe9..b4901b690c9a8473f1bd4bf8920536d3067cd9fd 100644 (file)
@@ -651,6 +651,7 @@ void ide_timer_expiry (unsigned long data)
                        }
                }
                hwif->handler = NULL;
+               hwif->expiry = NULL;
                /*
                 * We need to simulate a real interrupt when invoking
                 * the handler() function, which means we need to
@@ -830,6 +831,7 @@ irqreturn_t ide_intr (int irq, void *dev_id)
                goto out;
 
        hwif->handler = NULL;
+       hwif->expiry = NULL;
        hwif->req_gen++;
        del_timer(&hwif->timer);
        spin_unlock(&hwif->lock);
index c3023de7270c351d751af69b43c8a4474c659761..916495ba45df52627abe6e622beb72ebd4127109 100644 (file)
@@ -425,26 +425,25 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
  * See also ide_execute_command
  */
 void __ide_set_handler(ide_drive_t *drive, ide_handler_t *handler,
-                      unsigned int timeout, ide_expiry_t *expiry)
+                      unsigned int timeout)
 {
        ide_hwif_t *hwif = drive->hwif;
 
        BUG_ON(hwif->handler);
        hwif->handler           = handler;
-       hwif->expiry            = expiry;
        hwif->timer.expires     = jiffies + timeout;
        hwif->req_gen_timer     = hwif->req_gen;
        add_timer(&hwif->timer);
 }
 
-void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
-                     unsigned int timeout, ide_expiry_t *expiry)
+void ide_set_handler(ide_drive_t *drive, ide_handler_t *handler,
+                    unsigned int timeout)
 {
        ide_hwif_t *hwif = drive->hwif;
        unsigned long flags;
 
        spin_lock_irqsave(&hwif->lock, flags);
-       __ide_set_handler(drive, handler, timeout, expiry);
+       __ide_set_handler(drive, handler, timeout);
        spin_unlock_irqrestore(&hwif->lock, flags);
 }
 EXPORT_SYMBOL(ide_set_handler);
@@ -469,8 +468,10 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
        ide_hwif_t *hwif = drive->hwif;
        unsigned long flags;
 
+       hwif->expiry = expiry;
+
        spin_lock_irqsave(&hwif->lock, flags);
-       __ide_set_handler(drive, handler, timeout, expiry);
+       __ide_set_handler(drive, handler, timeout);
        hwif->tp_ops->exec_command(hwif, cmd);
        /*
         * Drive takes 400nS to respond, we must avoid the IRQ being
index 63ab233ba942dac7bd4c2992e8305848c163dadb..286804142e4dc624f018e3efd82d0e995be51bbd 100644 (file)
@@ -140,7 +140,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
                } else if (custom && tf->command == ATA_CMD_INIT_DEV_PARAMS) {
                        if ((stat & (ATA_ERR | ATA_DRQ)) == 0) {
                                ide_set_handler(drive, &task_no_data_intr,
-                                               WAIT_WORSTCASE, NULL);
+                                               WAIT_WORSTCASE);
                                return ide_started;
                        }
                }
@@ -347,7 +347,7 @@ static ide_startstop_t task_pio_intr(ide_drive_t *drive)
        }
 out_wait:
        /* Still data left to transfer. */
-       ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE, NULL);
+       ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE);
        return ide_started;
 out_end:
        if ((cmd->tf_flags & IDE_TFLAG_FS) == 0)
@@ -377,7 +377,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive,
        if ((drive->dev_flags & IDE_DFLAG_UNMASK) == 0)
                local_irq_disable();
 
-       ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE, NULL);
+       ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE);
 
        ide_pio_datablock(drive, cmd, 1);
 
index e339d66465528fc3e5879b094052a3b48164f8f0..476f59885fda4579fab0ade9dfbc5c4e24e01f9d 100644 (file)
@@ -1135,10 +1135,8 @@ unsigned int ide_rq_bytes(struct request *);
 int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int);
 void ide_kill_rq(ide_drive_t *, struct request *);
 
-void __ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int,
-                      ide_expiry_t *);
-void ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int,
-                    ide_expiry_t *);
+void __ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int);
+void ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int);
 
 void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int,
                         ide_expiry_t *);