]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tty/serial: altera_uart: Convert timers to use timer_setup()
authorKees Cook <keescook@chromium.org>
Tue, 24 Oct 2017 09:59:56 +0000 (02:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Nov 2017 11:01:54 +0000 (12:01 +0100)
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: Tobias Klauser <tklauser@distanz.ch>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org
Cc: nios2-dev@lists.rocketboards.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/altera_uart.c

index 3e4b717670d7432e32d4b66568900773f6e239ce..a0360e6408374a1873343873beea318d75b74ad3 100644 (file)
@@ -288,10 +288,10 @@ static irqreturn_t altera_uart_interrupt(int irq, void *data)
        return IRQ_RETVAL(isr);
 }
 
-static void altera_uart_timer(unsigned long data)
+static void altera_uart_timer(struct timer_list *t)
 {
-       struct uart_port *port = (void *)data;
-       struct altera_uart *pp = container_of(port, struct altera_uart, port);
+       struct altera_uart *pp = from_timer(pp, t, tmr);
+       struct uart_port *port = &pp->port;
 
        altera_uart_interrupt(0, port);
        mod_timer(&pp->tmr, jiffies + uart_poll_timeout(port));
@@ -314,7 +314,7 @@ static int altera_uart_startup(struct uart_port *port)
        int ret;
 
        if (!port->irq) {
-               setup_timer(&pp->tmr, altera_uart_timer, (unsigned long)port);
+               timer_setup(&pp->tmr, altera_uart_timer, 0);
                mod_timer(&pp->tmr, jiffies + uart_poll_timeout(port));
                return 0;
        }