staging: speakup: use tty_kopen and tty_kclose
authorOkash Khawaja <okash.khawaja@gmail.com>
Thu, 20 Jul 2017 07:22:37 +0000 (08:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 14:15:42 +0000 (16:15 +0200)
This patch replaces call to tty_open_by_driver with a tty_kopen and
uses tty_kclose instead of tty_release_struct to close it.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/spk_ttyio.c

index f643167..4d7d8f2 100644 (file)
@@ -144,7 +144,7 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth)
        if (ret)
                return ret;
 
-       tty = tty_open_by_driver(dev, NULL, NULL);
+       tty = tty_kopen(dev);
        if (IS_ERR(tty))
                return PTR_ERR(tty);
 
@@ -337,7 +337,7 @@ void spk_ttyio_release(void)
 
        tty_ldisc_flush(speakup_tty);
        tty_unlock(speakup_tty);
-       tty_release_struct(speakup_tty, speakup_tty->index);
+       tty_kclose(speakup_tty);
 }
 EXPORT_SYMBOL_GPL(spk_ttyio_release);