Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: amba-pl011: 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.

Cc: Russell King <linux@armlinux.org.uk>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kees Cook and committed by
Greg Kroah-Hartman
f7f73096 75d1760f

+3 -5
+3 -5
drivers/tty/serial/amba-pl011.c
··· 1078 1078 * Every polling, It checks the residue in the dma buffer and transfer 1079 1079 * data to the tty. Also, last_residue is updated for the next polling. 1080 1080 */ 1081 - static void pl011_dma_rx_poll(unsigned long args) 1081 + static void pl011_dma_rx_poll(struct timer_list *t) 1082 1082 { 1083 - struct uart_amba_port *uap = (struct uart_amba_port *)args; 1083 + struct uart_amba_port *uap = from_timer(uap, t, dmarx.timer); 1084 1084 struct tty_port *port = &uap->port.state->port; 1085 1085 struct pl011_dmarx_data *dmarx = &uap->dmarx; 1086 1086 struct dma_chan *rxchan = uap->dmarx.chan; ··· 1192 1192 dev_dbg(uap->port.dev, "could not trigger initial " 1193 1193 "RX DMA job, fall back to interrupt mode\n"); 1194 1194 if (uap->dmarx.poll_rate) { 1195 - init_timer(&(uap->dmarx.timer)); 1196 - uap->dmarx.timer.function = pl011_dma_rx_poll; 1197 - uap->dmarx.timer.data = (unsigned long)uap; 1195 + timer_setup(&uap->dmarx.timer, pl011_dma_rx_poll, 0); 1198 1196 mod_timer(&uap->dmarx.timer, 1199 1197 jiffies + 1200 1198 msecs_to_jiffies(uap->dmarx.poll_rate));