diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-24 03:00:10 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-04 12:01:54 +0100 |
commit | 4790b6dc7ad6c0f1eb71b94c4babe10a9c41c697 (patch) | |
tree | 6489bae7a8baa9c8ed1f097a06beaad5f2445813 /drivers/tty/vcc.c | |
parent | ad0cda7a90f26970d65163095c5da39f541921bc (diff) | |
download | talos-op-linux-4790b6dc7ad6c0f1eb71b94c4babe10a9c41c697.tar.gz talos-op-linux-4790b6dc7ad6c0f1eb71b94c4babe10a9c41c697.zip |
tty: vcc: 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: "David S. Miller" <davem@davemloft.net>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vcc.c')
-rw-r--r-- | drivers/tty/vcc.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index 954b190526e7..58b454c34560 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -361,17 +361,13 @@ done: return rv; } -static void vcc_rx_timer(unsigned long index) +static void vcc_rx_timer(struct timer_list *t) { + struct vcc_port *port = from_timer(port, t, rx_timer); struct vio_driver_state *vio; - struct vcc_port *port; unsigned long flags; int rv; - port = vcc_get_ne(index); - if (!port) - return; - spin_lock_irqsave(&port->lock, flags); port->rx_timer.expires = 0; @@ -391,18 +387,14 @@ done: vcc_put(port, false); } -static void vcc_tx_timer(unsigned long index) +static void vcc_tx_timer(struct timer_list *t) { - struct vcc_port *port; + struct vcc_port *port = from_timer(port, t, tx_timer); struct vio_vcc *pkt; unsigned long flags; int tosend = 0; int rv; - port = vcc_get_ne(index); - if (!port) - return; - spin_lock_irqsave(&port->lock, flags); port->tx_timer.expires = 0; @@ -645,8 +637,8 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id) if (rv) goto free_domain; - setup_timer(&port->rx_timer, vcc_rx_timer, port->index); - setup_timer(&port->tx_timer, vcc_tx_timer, port->index); + timer_setup(&port->rx_timer, vcc_rx_timer, 0); + timer_setup(&port->tx_timer, vcc_tx_timer, 0); dev_set_drvdata(&vdev->dev, port); |