diff options
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 685fb69bcc32..6bf22a28adb8 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -281,7 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp) | |||
281 | static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count) | 281 | static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count) |
282 | { | 282 | { |
283 | struct usb_serial_port *port = tty->driver_data; | 283 | struct usb_serial_port *port = tty->driver_data; |
284 | int retval = -EINVAL; | 284 | int retval = -ENODEV; |
285 | 285 | ||
286 | if (!port || port->serial->dev->state == USB_STATE_NOTATTACHED) | 286 | if (!port || port->serial->dev->state == USB_STATE_NOTATTACHED) |
287 | goto exit; | 287 | goto exit; |
@@ -289,6 +289,7 @@ static int serial_write (struct tty_struct * tty, const unsigned char *buf, int | |||
289 | dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count); | 289 | dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count); |
290 | 290 | ||
291 | if (!port->open_count) { | 291 | if (!port->open_count) { |
292 | retval = -EINVAL; | ||
292 | dbg("%s - port not opened", __FUNCTION__); | 293 | dbg("%s - port not opened", __FUNCTION__); |
293 | goto exit; | 294 | goto exit; |
294 | } | 295 | } |