This was already the case in elmcan_ldisc_tx_worker(), but was missing
in elm327_send().
static DEFINE_SPINLOCK(elmcan_discdata_lock);
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);
*/
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;
}
elm->txleft = len - actual;
elm->txhead = elm->txbuf + actual;
}
To Do list for future development
----------------------------------
To Do list for future development
----------------------------------
-- Handle ``write()`` error
-
- Rename ``elm327_panic()``
- No auto-restart in ``elm327_panic()``?
- Rename ``elm327_panic()``
- No auto-restart in ``elm327_panic()``?