From bc47ba90b01afe468cdd586b0dbe59b64862e2b7 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 08:34:29 -0700 Subject: ALSA: drivers: Convert timers to use timer_setup() 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. Signed-off-by: Kees Cook Signed-off-by: Takashi Iwai --- sound/drivers/serial-u16550.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound/drivers/serial-u16550.c') diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 88e66ea0306d..0a67b8b9f176 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -309,12 +309,12 @@ static irqreturn_t snd_uart16550_interrupt(int irq, void *dev_id) } /* When the polling mode, this function calls snd_uart16550_io_loop. */ -static void snd_uart16550_buffer_timer(unsigned long data) +static void snd_uart16550_buffer_timer(struct timer_list *t) { unsigned long flags; struct snd_uart16550 *uart; - uart = (struct snd_uart16550 *)data; + uart = from_timer(uart, t, buffer_timer); spin_lock_irqsave(&uart->open_lock, flags); snd_uart16550_del_timer(uart); snd_uart16550_io_loop(uart); @@ -828,8 +828,7 @@ 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); - setup_timer(&uart->buffer_timer, snd_uart16550_buffer_timer, - (unsigned long)uart); + timer_setup(&uart->buffer_timer, snd_uart16550_buffer_timer, 0); uart->timer_running = 0; /* Register device */ -- cgit