]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/tty/vcc.c
sh/boot: add static stack-protector to pre-kernel
[mirror_ubuntu-bionic-kernel.git] / drivers / tty / vcc.c
index ef01d24858cd659b9d667c964536fe6798bde6bb..58b454c34560a76f098269644f6368049312a543 100644 (file)
@@ -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,13 +637,8 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
        if (rv)
                goto free_domain;
 
-       init_timer(&port->rx_timer);
-       port->rx_timer.function = vcc_rx_timer;
-       port->rx_timer.data = port->index;
-
-       init_timer(&port->tx_timer);
-       port->tx_timer.function = vcc_tx_timer;
-       port->tx_timer.data = 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);