static DEFINE_SPINLOCK(elmcan_discdata_lock);
+static inline void elm327_panic(struct elmcan *elm);
+
/************************************************************************
*/
set_bit(TTY_DO_WRITE_WAKEUP, &elm->tty->flags);
actual = elm->tty->ops->write(elm->tty, elm->txbuf, len);
+ if (actual < 0) {
+ pr_err("Failed to write to tty for %s.\n", elm->dev->name);
+ elm327_panic(elm);
+ }
+
elm->txleft = len - actual;
elm->txhead = elm->txbuf + actual;
}