]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: line6: Use setup_timer() and mod_timer()
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:44:40 +0000 (11:44 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:46:02 +0000 (11:46 +0100)
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/line6/driver.c
sound/usb/line6/toneport.c

index fc852f6ab8bc663ea70783ecfd440dff719d7a40..19904d677114920e42529758248b070744a69696 100644 (file)
@@ -415,8 +415,7 @@ void line6_start_timer(struct timer_list *timer, unsigned int msecs,
                       void (*function)(unsigned long), unsigned long data)
 {
        setup_timer(timer, function, data);
-       timer->expires = jiffies + msecs * HZ / 1000;
-       add_timer(timer);
+       mod_timer(timer, jiffies + msecs * HZ / 1000);
 }
 
 /*
index aae78d8a82d9be0b5c561b91c31a45890b61a3cc..7f97f4a812a7a39401ed7e5ab5b58717e519de05 100644 (file)
@@ -433,11 +433,9 @@ static int toneport_try_init(struct usb_interface *interface,
 
        toneport_setup(toneport);
 
-       init_timer(&toneport->timer);
-       toneport->timer.expires = jiffies + TONEPORT_PCM_DELAY * HZ;
-       toneport->timer.function = toneport_start_pcm;
-       toneport->timer.data = (unsigned long)toneport;
-       add_timer(&toneport->timer);
+       setup_timer(&toneport->timer, toneport_start_pcm,
+                   (unsigned long)toneport);
+       mod_timer(&toneport->timer, jiffies + TONEPORT_PCM_DELAY * HZ);
 
        return 0;
 }