summaryrefslogtreecommitdiff
path: root/drivers/net/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/hso.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 24bc1e678b7b..7dc1ef3f93c3 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -3241,9 +3241,10 @@ static int __init hso_init(void)
serial_table[i] = NULL;
/* allocate our driver using the proper amount of supported minors */
- tty_drv = alloc_tty_driver(HSO_SERIAL_TTY_MINORS);
- if (!tty_drv)
- return -ENOMEM;
+ tty_drv = tty_alloc_driver(HSO_SERIAL_TTY_MINORS, TTY_DRIVER_REAL_RAW |
+ TTY_DRIVER_DYNAMIC_DEV);
+ if (IS_ERR(tty_drv))
+ return PTR_ERR(tty_drv);
/* fill in all needed values */
tty_drv->driver_name = driver_name;
@@ -3256,7 +3257,6 @@ static int __init hso_init(void)
tty_drv->minor_start = 0;
tty_drv->type = TTY_DRIVER_TYPE_SERIAL;
tty_drv->subtype = SERIAL_TYPE_NORMAL;
- tty_drv->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
tty_drv->init_termios = tty_std_termios;
hso_init_termios(&tty_drv->init_termios);
tty_set_operations(tty_drv, &hso_serial_ops);
@@ -3281,7 +3281,7 @@ static int __init hso_init(void)
err_unreg_tty:
tty_unregister_driver(tty_drv);
err_free_tty:
- put_tty_driver(tty_drv);
+ tty_driver_kref_put(tty_drv);
return result;
}
@@ -3292,7 +3292,7 @@ static void __exit hso_exit(void)
tty_unregister_driver(tty_drv);
/* deregister the usb driver */
usb_deregister(&hso_driver);
- put_tty_driver(tty_drv);
+ tty_driver_kref_put(tty_drv);
}
/* Module definitions */