From 7b94cae47cbfaa1a64cd51b3735eba3abe6af827 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 26 Jun 2013 16:47:25 +0200 Subject: USB: console: use dev_dbg Use dev_dbg for debugging. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/console.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/usb/serial/console.c') diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index afb50eab204..bfad2cd39bf 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -210,10 +210,10 @@ static void usb_console_write(struct console *co, if (count == 0) return; - pr_debug("%s - minor %d, %d byte(s)\n", __func__, port->minor, count); + dev_dbg(&port->dev, "%s - %d byte(s)\n", __func__, count); if (!port->port.console) { - pr_debug("%s - port not opened\n", __func__); + dev_dbg(&port->dev, "%s - port not opened\n", __func__); return; } @@ -234,7 +234,7 @@ static void usb_console_write(struct console *co, retval = serial->type->write(NULL, port, buf, i); else retval = usb_serial_generic_write(NULL, port, buf, i); - pr_debug("%s - return value : %d\n", __func__, retval); + dev_dbg(&port->dev, "%s - write: %d\n", __func__, retval); if (lf) { /* append CR after LF */ unsigned char cr = 13; @@ -244,7 +244,8 @@ static void usb_console_write(struct console *co, else retval = usb_serial_generic_write(NULL, port, &cr, 1); - pr_debug("%s - return value : %d\n", __func__, retval); + dev_dbg(&port->dev, "%s - write cr: %d\n", + __func__, retval); } buf += i; count -= i; -- cgit v1.2.3-70-g09d2 From c7b13475b4466adcdcd8378f12b4ee416ef9b98b Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 26 Jun 2013 16:47:26 +0200 Subject: USB: console: remove unnecessary operations test Remove unnecessary tests for open and write operations as these are set to the generic implementations by usb-serial core if left unset by a subdriver. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/console.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'drivers/usb/serial/console.c') diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index bfad2cd39bf..c69bb50d466 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -151,11 +151,7 @@ static int usb_console_setup(struct console *co, char *options) /* only call the device specific open if this * is the first time the port is opened */ - if (serial->type->open) - retval = serial->type->open(NULL, port); - else - retval = usb_serial_generic_open(NULL, port); - + retval = serial->type->open(NULL, port); if (retval) { dev_err(&port->dev, "could not open USB console port\n"); goto fail; @@ -230,20 +226,12 @@ static void usb_console_write(struct console *co, } /* pass on to the driver specific version of this function if it is available */ - if (serial->type->write) - retval = serial->type->write(NULL, port, buf, i); - else - retval = usb_serial_generic_write(NULL, port, buf, i); + retval = serial->type->write(NULL, port, buf, i); dev_dbg(&port->dev, "%s - write: %d\n", __func__, retval); if (lf) { /* append CR after LF */ unsigned char cr = 13; - if (serial->type->write) - retval = serial->type->write(NULL, - port, &cr, 1); - else - retval = usb_serial_generic_write(NULL, - port, &cr, 1); + retval = serial->type->write(NULL, port, &cr, 1); dev_dbg(&port->dev, "%s - write cr: %d\n", __func__, retval); } -- cgit v1.2.3-70-g09d2