]> xenbits.xensource.com Git - people/aperard/linux.git/commitdiff
ide: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Wed, 18 Oct 2017 04:06:32 +0000 (21:06 -0700)
committerKees Cook <keescook@chromium.org>
Mon, 6 Nov 2017 20:50:03 +0000 (12:50 -0800)
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
drivers/ide/ide-io.c
drivers/ide/ide-probe.c
include/linux/ide.h

index 3a234701d92c4ac3965cce3e48edc6ef856ca9a0..6f25da56a1690cfaaa3183a5b9b489474865dab5 100644 (file)
@@ -611,9 +611,9 @@ static int drive_is_ready(ide_drive_t *drive)
  *     logic that wants cleaning up.
  */
  
-void ide_timer_expiry (unsigned long data)
+void ide_timer_expiry (struct timer_list *t)
 {
-       ide_hwif_t      *hwif = (ide_hwif_t *)data;
+       ide_hwif_t      *hwif = from_timer(hwif, t, timer);
        ide_drive_t     *uninitialized_var(drive);
        ide_handler_t   *handler;
        unsigned long   flags;
index 01b2adfd8226bf1bcd048100f4e4bcb0f6afb180..27a2488c7468c0ee34cd07ebd87cbbed3d84a539 100644 (file)
@@ -1184,7 +1184,7 @@ static void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
 
        spin_lock_init(&hwif->lock);
 
-       setup_timer(&hwif->timer, &ide_timer_expiry, (unsigned long)hwif);
+       timer_setup(&hwif->timer, ide_timer_expiry, 0);
 
        init_completion(&hwif->gendev_rel_comp);
 
index dc152e4b7f732ed294bde4f1f2e87fc2277d6262..cc412175d0362e649d41a79a354b427899a87f2d 100644 (file)
@@ -1211,7 +1211,7 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout);
 
 extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
 
-extern void ide_timer_expiry(unsigned long);
+extern void ide_timer_expiry(struct timer_list *t);
 extern irqreturn_t ide_intr(int irq, void *dev_id);
 extern void do_ide_request(struct request_queue *);
 extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq);