-
- if (cpc_tty->tty && (cpc_tty->tty->ldisc.receive_buf)) {
- CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name);
- cpc_tty->tty->ldisc.receive_buf(cpc_tty->tty, (char *)(buf->data),
- &flags, buf->size);
+ if(cpc_tty->tty) {
+ ld = tty_ldisc_ref(cpc_tty->tty);
+ if(ld) {
+ if (ld->receive_buf) {
+ CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name);
+ ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size);
+ }
+ tty_ldisc_deref(ld);
+ }