OSDN Git Service

net: usb: hso: use new tasklet API
authorEmil Renner Berthing <kernel@esmil.dk>
Sat, 30 Jan 2021 23:47:26 +0000 (00:47 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Feb 2021 23:51:18 +0000 (15:51 -0800)
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")

Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/hso.c

index ef6dd01..31d5134 100644 (file)
@@ -1213,9 +1213,10 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
  * This needs to be a tasklet otherwise we will
  * end up recursively calling this function.
  */
-static void hso_unthrottle_tasklet(unsigned long data)
+static void hso_unthrottle_tasklet(struct tasklet_struct *t)
 {
-       struct hso_serial *serial = (struct hso_serial *)data;
+       struct hso_serial *serial = from_tasklet(serial, t,
+                                                unthrottle_tasklet);
        unsigned long flags;
 
        spin_lock_irqsave(&serial->serial_lock, flags);
@@ -1264,9 +1265,8 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
                serial->rx_state = RX_IDLE;
                /* Force default termio settings */
                _hso_serial_set_termios(tty, NULL);
-               tasklet_init(&serial->unthrottle_tasklet,
-                            hso_unthrottle_tasklet,
-                            (unsigned long)serial);
+               tasklet_setup(&serial->unthrottle_tasklet,
+                             hso_unthrottle_tasklet);
                result = hso_start_serial_device(serial->parent, GFP_KERNEL);
                if (result) {
                        hso_stop_serial_device(serial->parent);