aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-03-21 07:36:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 16:42:13 -0400
commitd12e211d44844930b7460ffab43ff9b078a45369 (patch)
tree0ec13c5b07de86a9bbd7277d9d2cc2ece9ed9c53 /drivers/usb/serial/usb-serial.c
parent9993b42b638ec031a55bfe1bc16317cbb5c69722 (diff)
USB: serial: clean up debug info
Remove redundant port number from debug output (already printed as part of device name). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 262beefca71e..fee8d8a04f7b 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -247,7 +247,8 @@ static int serial_open(struct tty_struct *tty, struct file *filp)
247{ 247{
248 struct usb_serial_port *port = tty->driver_data; 248 struct usb_serial_port *port = tty->driver_data;
249 249
250 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 250 dev_dbg(tty->dev, "%s\n", __func__);
251
251 return tty_port_open(&port->port, tty, filp); 252 return tty_port_open(&port->port, tty, filp);
252} 253}
253 254
@@ -275,7 +276,8 @@ static void serial_hangup(struct tty_struct *tty)
275{ 276{
276 struct usb_serial_port *port = tty->driver_data; 277 struct usb_serial_port *port = tty->driver_data;
277 278
278 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 279 dev_dbg(tty->dev, "%s\n", __func__);
280
279 tty_port_hangup(&port->port); 281 tty_port_hangup(&port->port);
280} 282}
281 283
@@ -283,7 +285,8 @@ static void serial_close(struct tty_struct *tty, struct file *filp)
283{ 285{
284 struct usb_serial_port *port = tty->driver_data; 286 struct usb_serial_port *port = tty->driver_data;
285 287
286 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 288 dev_dbg(tty->dev, "%s\n", __func__);
289
287 tty_port_close(&port->port, tty, filp); 290 tty_port_close(&port->port, tty, filp);
288} 291}
289 292
@@ -302,14 +305,14 @@ static void serial_cleanup(struct tty_struct *tty)
302 struct usb_serial *serial; 305 struct usb_serial *serial;
303 struct module *owner; 306 struct module *owner;
304 307
308 dev_dbg(tty->dev, "%s\n", __func__);
309
305 /* The console is magical. Do not hang up the console hardware 310 /* The console is magical. Do not hang up the console hardware
306 * or there will be tears. 311 * or there will be tears.
307 */ 312 */
308 if (port->port.console) 313 if (port->port.console)
309 return; 314 return;
310 315
311 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number);
312
313 tty->driver_data = NULL; 316 tty->driver_data = NULL;
314 317
315 serial = port->serial; 318 serial = port->serial;
@@ -333,8 +336,7 @@ static int serial_write(struct tty_struct *tty, const unsigned char *buf,
333 if (port->serial->dev->state == USB_STATE_NOTATTACHED) 336 if (port->serial->dev->state == USB_STATE_NOTATTACHED)
334 goto exit; 337 goto exit;
335 338
336 dev_dbg(tty->dev, "%s - port %d, %d byte(s)\n", __func__, 339 dev_dbg(tty->dev, "%s - %d byte(s)\n", __func__, count);
337 port->number, count);
338 340
339 retval = port->serial->type->write(tty, port, buf, count); 341 retval = port->serial->type->write(tty, port, buf, count);
340 if (retval < 0) 342 if (retval < 0)
@@ -347,7 +349,7 @@ static int serial_write_room(struct tty_struct *tty)
347{ 349{
348 struct usb_serial_port *port = tty->driver_data; 350 struct usb_serial_port *port = tty->driver_data;
349 351
350 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 352 dev_dbg(tty->dev, "%s\n", __func__);
351 353
352 return port->serial->type->write_room(tty); 354 return port->serial->type->write_room(tty);
353} 355}
@@ -358,7 +360,7 @@ static int serial_chars_in_buffer(struct tty_struct *tty)
358 struct usb_serial *serial = port->serial; 360 struct usb_serial *serial = port->serial;
359 int count = 0; 361 int count = 0;
360 362
361 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 363 dev_dbg(tty->dev, "%s\n", __func__);
362 364
363 mutex_lock(&serial->disc_mutex); 365 mutex_lock(&serial->disc_mutex);
364 /* if the device was unplugged then any remaining characters 366 /* if the device was unplugged then any remaining characters
@@ -376,7 +378,7 @@ static void serial_throttle(struct tty_struct *tty)
376{ 378{
377 struct usb_serial_port *port = tty->driver_data; 379 struct usb_serial_port *port = tty->driver_data;
378 380
379 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 381 dev_dbg(tty->dev, "%s\n", __func__);
380 382
381 if (port->serial->type->throttle) 383 if (port->serial->type->throttle)
382 port->serial->type->throttle(tty); 384 port->serial->type->throttle(tty);
@@ -386,7 +388,7 @@ static void serial_unthrottle(struct tty_struct *tty)
386{ 388{
387 struct usb_serial_port *port = tty->driver_data; 389 struct usb_serial_port *port = tty->driver_data;
388 390
389 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 391 dev_dbg(tty->dev, "%s\n", __func__);
390 392
391 if (port->serial->type->unthrottle) 393 if (port->serial->type->unthrottle)
392 port->serial->type->unthrottle(tty); 394 port->serial->type->unthrottle(tty);
@@ -398,8 +400,7 @@ static int serial_ioctl(struct tty_struct *tty,
398 struct usb_serial_port *port = tty->driver_data; 400 struct usb_serial_port *port = tty->driver_data;
399 int retval = -ENODEV; 401 int retval = -ENODEV;
400 402
401 dev_dbg(tty->dev, "%s - port %d, cmd 0x%.4x\n", __func__, 403 dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd);
402 port->number, cmd);
403 404
404 if (port->serial->type->ioctl) 405 if (port->serial->type->ioctl)
405 retval = port->serial->type->ioctl(tty, cmd, arg); 406 retval = port->serial->type->ioctl(tty, cmd, arg);
@@ -413,7 +414,7 @@ static void serial_set_termios(struct tty_struct *tty, struct ktermios *old)
413{ 414{
414 struct usb_serial_port *port = tty->driver_data; 415 struct usb_serial_port *port = tty->driver_data;
415 416
416 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 417 dev_dbg(tty->dev, "%s\n", __func__);
417 418
418 if (port->serial->type->set_termios) 419 if (port->serial->type->set_termios)
419 port->serial->type->set_termios(tty, port, old); 420 port->serial->type->set_termios(tty, port, old);
@@ -425,7 +426,7 @@ static int serial_break(struct tty_struct *tty, int break_state)
425{ 426{
426 struct usb_serial_port *port = tty->driver_data; 427 struct usb_serial_port *port = tty->driver_data;
427 428
428 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 429 dev_dbg(tty->dev, "%s\n", __func__);
429 430
430 if (port->serial->type->break_ctl) 431 if (port->serial->type->break_ctl)
431 port->serial->type->break_ctl(tty, break_state); 432 port->serial->type->break_ctl(tty, break_state);
@@ -483,7 +484,7 @@ static int serial_tiocmget(struct tty_struct *tty)
483{ 484{
484 struct usb_serial_port *port = tty->driver_data; 485 struct usb_serial_port *port = tty->driver_data;
485 486
486 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 487 dev_dbg(tty->dev, "%s\n", __func__);
487 488
488 if (port->serial->type->tiocmget) 489 if (port->serial->type->tiocmget)
489 return port->serial->type->tiocmget(tty); 490 return port->serial->type->tiocmget(tty);
@@ -495,7 +496,7 @@ static int serial_tiocmset(struct tty_struct *tty,
495{ 496{
496 struct usb_serial_port *port = tty->driver_data; 497 struct usb_serial_port *port = tty->driver_data;
497 498
498 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 499 dev_dbg(tty->dev, "%s\n", __func__);
499 500
500 if (port->serial->type->tiocmset) 501 if (port->serial->type->tiocmset)
501 return port->serial->type->tiocmset(tty, set, clear); 502 return port->serial->type->tiocmset(tty, set, clear);
@@ -507,7 +508,7 @@ static int serial_get_icount(struct tty_struct *tty,
507{ 508{
508 struct usb_serial_port *port = tty->driver_data; 509 struct usb_serial_port *port = tty->driver_data;
509 510
510 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 511 dev_dbg(tty->dev, "%s\n", __func__);
511 512
512 if (port->serial->type->get_icount) 513 if (port->serial->type->get_icount)
513 return port->serial->type->get_icount(tty, icount); 514 return port->serial->type->get_icount(tty, icount);
@@ -535,7 +536,7 @@ static void usb_serial_port_work(struct work_struct *work)
535 if (!tty) 536 if (!tty)
536 return; 537 return;
537 538
538 dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number); 539 dev_dbg(tty->dev, "%s\n", __func__);
539 540
540 tty_wakeup(tty); 541 tty_wakeup(tty);
541 tty_kref_put(tty); 542 tty_kref_put(tty);