]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/tty/n_gsm.c
TTY: add tty_port_tty_hangup helper
[karo-tx-linux.git] / drivers / tty / n_gsm.c
index 4a43ef5d7962c9b043dc047ac16a5207f656bfa7..74d9a0258d7c2126c3e34a2781e8ecf03c7281d3 100644 (file)
@@ -1418,11 +1418,7 @@ static void gsm_dlci_close(struct gsm_dlci *dlci)
                pr_debug("DLCI %d goes closed.\n", dlci->addr);
        dlci->state = DLCI_CLOSED;
        if (dlci->addr != 0) {
-               struct tty_struct  *tty = tty_port_tty_get(&dlci->port);
-               if (tty) {
-                       tty_hangup(tty);
-                       tty_kref_put(tty);
-               }
+               tty_port_tty_hangup(&dlci->port, false);
                kfifo_reset(dlci->fifo);
        } else
                dlci->gsm->dead = 1;