@@ -477,10 +477,12 @@ static int keyspan_pda_write(struct tty_
count = (count > port->bulk_out_size) ? port->bulk_out_size : count;
- /* Check if we might overrun the Tx buffer. If so, ask the
- device how much room it really has. This is done only on
- scheduler time, since usb_control_msg() sleeps. */
- if (count > priv->tx_room && !in_interrupt()) {
+ /*
+ * Check if we might overrun the Tx buffer. If so, ask the device
+ * how much room it really has. This can only be invoked for tty
+ * usage because the console write can't sleep.
+ */
+ if (count > priv->tx_room && tty) {
u8 *room;
room = kmalloc(1, GFP_KERNEL);