Merge tag 'fscache-next-20210829' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / arch / m68k / emu / nfcon.c
index f393af3..557d608 100644 (file)
@@ -127,9 +127,9 @@ static int __init nfcon_init(void)
        if (!stderr_id)
                return -ENODEV;
 
-       driver = alloc_tty_driver(1);
-       if (!driver)
-               return -ENOMEM;
+       driver = tty_alloc_driver(1, TTY_DRIVER_REAL_RAW);
+       if (IS_ERR(driver))
+               return PTR_ERR(driver);
 
        tty_port_init(&nfcon_tty_port);
 
@@ -138,14 +138,13 @@ static int __init nfcon_init(void)
        driver->type = TTY_DRIVER_TYPE_SYSTEM;
        driver->subtype = SYSTEM_TYPE_TTY;
        driver->init_termios = tty_std_termios;
-       driver->flags = TTY_DRIVER_REAL_RAW;
 
        tty_set_operations(driver, &nfcon_tty_ops);
        tty_port_link_device(&nfcon_tty_port, driver, 0);
        res = tty_register_driver(driver);
        if (res) {
                pr_err("failed to register nfcon tty driver\n");
-               put_tty_driver(driver);
+               tty_driver_kref_put(driver);
                tty_port_destroy(&nfcon_tty_port);
                return res;
        }
@@ -162,7 +161,7 @@ static void __exit nfcon_exit(void)
 {
        unregister_console(&nf_console);
        tty_unregister_driver(nfcon_tty_driver);
-       put_tty_driver(nfcon_tty_driver);
+       tty_driver_kref_put(nfcon_tty_driver);
        tty_port_destroy(&nfcon_tty_port);
 }