static DEFINE_SPINLOCK(elmcan_discdata_lock);
-static inline void elm327_panic(struct elmcan *elm);
+static inline void elm327_hw_failure(struct elmcan *elm);
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);
+ elm327_hw_failure(elm);
}
elm->txleft = len - actual;
/************************************************************************
- * ELM327: Panic handler *
+ * ELM327: "Panic" handler *
* *
* (assumes elm->lock taken) *
************************************************************************/
-static inline void elm327_panic(struct elmcan *elm)
+/* Called when we're out of ideas and just want it all to end. */
+static inline void elm327_hw_failure(struct elmcan *elm)
{
struct can_frame frame = {0};
* Did we even connect at the right baud rate?
*/
pr_err("RX buffer overflow. Faulty ELM327 connected?\n");
- elm327_panic(elm);
+ elm327_hw_failure(elm);
} else if (len == elm->rxfill) {
if (elm->state == ELM_RECEIVING
&& elm->rxbuf[elm->rxfill - 1] == ELM327_READY_CHAR) {
pr_err("Error in received character stream. Check your wiring.");
spin_lock_bh(&elm->lock);
- elm327_panic(elm);
+ elm327_hw_failure(elm);
spin_unlock_bh(&elm->lock);
put_elm(elm);
pr_err("Receive buffer overflowed. Bad chip or wiring?");
spin_lock_bh(&elm->lock);
- elm327_panic(elm);
+ elm327_hw_failure(elm);
spin_unlock_bh(&elm->lock);
put_elm(elm);
actual = elm->tty->ops->write(elm->tty, elm->txhead, elm->txleft);
if (actual < 0) {
pr_err("Failed to write to tty for %s.\n", elm->dev->name);
- elm327_panic(elm);
+ elm327_hw_failure(elm);
}
elm->txleft -= actual;