diff options
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r-- | drivers/usb/serial/console.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 9a564286bfd7..5f3bcd31e204 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -11,6 +11,8 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
14 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | 17 | #include <linux/init.h> |
16 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
@@ -20,8 +22,6 @@ | |||
20 | #include <linux/usb.h> | 22 | #include <linux/usb.h> |
21 | #include <linux/usb/serial.h> | 23 | #include <linux/usb/serial.h> |
22 | 24 | ||
23 | static int debug; | ||
24 | |||
25 | struct usbcons_info { | 25 | struct usbcons_info { |
26 | int magic; | 26 | int magic; |
27 | int break_flag; | 27 | int break_flag; |
@@ -68,8 +68,6 @@ static int usb_console_setup(struct console *co, char *options) | |||
68 | struct tty_struct *tty = NULL; | 68 | struct tty_struct *tty = NULL; |
69 | struct ktermios dummy; | 69 | struct ktermios dummy; |
70 | 70 | ||
71 | dbg("%s", __func__); | ||
72 | |||
73 | if (options) { | 71 | if (options) { |
74 | baud = simple_strtoul(options, NULL, 10); | 72 | baud = simple_strtoul(options, NULL, 10); |
75 | s = options; | 73 | s = options; |
@@ -113,8 +111,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
113 | serial = usb_serial_get_by_index(co->index); | 111 | serial = usb_serial_get_by_index(co->index); |
114 | if (serial == NULL) { | 112 | if (serial == NULL) { |
115 | /* no device is connected yet, sorry :( */ | 113 | /* no device is connected yet, sorry :( */ |
116 | printk(KERN_ERR "No USB device connected to ttyUSB%i\n", | 114 | pr_err("No USB device connected to ttyUSB%i\n", co->index); |
117 | co->index); | ||
118 | return -ENODEV; | 115 | return -ENODEV; |
119 | } | 116 | } |
120 | 117 | ||
@@ -213,10 +210,10 @@ static void usb_console_write(struct console *co, | |||
213 | if (count == 0) | 210 | if (count == 0) |
214 | return; | 211 | return; |
215 | 212 | ||
216 | dbg("%s - port %d, %d byte(s)", __func__, port->number, count); | 213 | pr_debug("%s - port %d, %d byte(s)\n", __func__, port->number, count); |
217 | 214 | ||
218 | if (!port->port.console) { | 215 | if (!port->port.console) { |
219 | dbg("%s - port not opened", __func__); | 216 | pr_debug("%s - port not opened\n", __func__); |
220 | return; | 217 | return; |
221 | } | 218 | } |
222 | 219 | ||
@@ -237,7 +234,7 @@ static void usb_console_write(struct console *co, | |||
237 | retval = serial->type->write(NULL, port, buf, i); | 234 | retval = serial->type->write(NULL, port, buf, i); |
238 | else | 235 | else |
239 | retval = usb_serial_generic_write(NULL, port, buf, i); | 236 | retval = usb_serial_generic_write(NULL, port, buf, i); |
240 | dbg("%s - return value : %d", __func__, retval); | 237 | pr_debug("%s - return value : %d\n", __func__, retval); |
241 | if (lf) { | 238 | if (lf) { |
242 | /* append CR after LF */ | 239 | /* append CR after LF */ |
243 | unsigned char cr = 13; | 240 | unsigned char cr = 13; |
@@ -247,7 +244,7 @@ static void usb_console_write(struct console *co, | |||
247 | else | 244 | else |
248 | retval = usb_serial_generic_write(NULL, | 245 | retval = usb_serial_generic_write(NULL, |
249 | port, &cr, 1); | 246 | port, &cr, 1); |
250 | dbg("%s - return value : %d", __func__, retval); | 247 | pr_debug("%s - return value : %d\n", __func__, retval); |
251 | } | 248 | } |
252 | buf += i; | 249 | buf += i; |
253 | count -= i; | 250 | count -= i; |
@@ -284,10 +281,8 @@ void usb_serial_console_disconnect(struct usb_serial *serial) | |||
284 | } | 281 | } |
285 | } | 282 | } |
286 | 283 | ||
287 | void usb_serial_console_init(int serial_debug, int minor) | 284 | void usb_serial_console_init(int minor) |
288 | { | 285 | { |
289 | debug = serial_debug; | ||
290 | |||
291 | if (minor == 0) { | 286 | if (minor == 0) { |
292 | /* | 287 | /* |
293 | * Call register_console() if this is the first device plugged | 288 | * Call register_console() if this is the first device plugged |
@@ -302,7 +297,7 @@ void usb_serial_console_init(int serial_debug, int minor) | |||
302 | * register_console). console_write() is called immediately | 297 | * register_console). console_write() is called immediately |
303 | * from register_console iff CON_PRINTBUFFER is set in flags. | 298 | * from register_console iff CON_PRINTBUFFER is set in flags. |
304 | */ | 299 | */ |
305 | dbg("registering the USB serial console."); | 300 | pr_debug("registering the USB serial console.\n"); |
306 | register_console(&usbcons); | 301 | register_console(&usbcons); |
307 | } | 302 | } |
308 | } | 303 | } |