ALSA: serial-u16550: Use setup_timer() and mod_timer()
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:29:09 +0000 (11:29 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2015 10:32:26 +0000 (11:32 +0100)
No functional change, refactoring with the standard helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/serial-u16550.c

index 13a34e3c63823d8c604d636157a2044e2626d8e9..8c1dc73e14e49f5da9618178555d09949893fcca 100644 (file)
@@ -174,9 +174,8 @@ static inline void snd_uart16550_add_timer(struct snd_uart16550 *uart)
 {
        if (!uart->timer_running) {
                /* timer 38600bps * 10bit * 16byte */
-               uart->buffer_timer.expires = jiffies + (HZ+255)/256;
+               mod_timer(&uart->buffer_timer, jiffies + (HZ + 255) / 256);
                uart->timer_running = 1;
-               add_timer(&uart->buffer_timer);
        }
 }
 
@@ -830,9 +829,8 @@ static int snd_uart16550_create(struct snd_card *card,
        uart->prev_in = 0;
        uart->rstatus = 0;
        memset(uart->prev_status, 0x80, sizeof(unsigned char) * SNDRV_SERIAL_MAX_OUTS);
-       init_timer(&uart->buffer_timer);
-       uart->buffer_timer.function = snd_uart16550_buffer_timer;
-       uart->buffer_timer.data = (unsigned long)uart;
+       setup_timer(&uart->buffer_timer, snd_uart16550_buffer_timer,
+                   (unsigned long)uart);
        uart->timer_running = 0;
 
        /* Register device */