diff options
Diffstat (limited to 'drivers/usb/serial/garmin_gps.c')
-rw-r--r-- | drivers/usb/serial/garmin_gps.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 203358d7e7bc..1a07b12ef341 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c | |||
@@ -252,14 +252,11 @@ static inline int isAbortTrfCmnd(const unsigned char *buf) | |||
252 | static void send_to_tty(struct usb_serial_port *port, | 252 | static void send_to_tty(struct usb_serial_port *port, |
253 | char *data, unsigned int actual_length) | 253 | char *data, unsigned int actual_length) |
254 | { | 254 | { |
255 | struct tty_struct *tty = tty_port_tty_get(&port->port); | 255 | if (actual_length) { |
256 | |||
257 | if (tty && actual_length) { | ||
258 | usb_serial_debug_data(&port->dev, __func__, actual_length, data); | 256 | usb_serial_debug_data(&port->dev, __func__, actual_length, data); |
259 | tty_insert_flip_string(tty, data, actual_length); | 257 | tty_insert_flip_string(&port->port, data, actual_length); |
260 | tty_flip_buffer_push(tty); | 258 | tty_flip_buffer_push(&port->port); |
261 | } | 259 | } |
262 | tty_kref_put(tty); | ||
263 | } | 260 | } |
264 | 261 | ||
265 | 262 | ||