From 1a43f43bea7d3bfab230d5445291a8d5f91172ca Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 6 Feb 2012 19:22:19 +0100 Subject: [PATCH] --- yaml --- r: 289429 b: refs/heads/master c: e688355bfeadf17ef522b1e62cc12f8e88e69667 h: refs/heads/master i: 289427: fedd7edd3f61e41e4f238f6c67142d3c125b925f v: v3 --- [refs] | 2 +- trunk/include/linux/usb/serial.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6933f2c05f9b..aedfcafc6e40 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d35e70d50a0641ebc1502fd343bef9b4011ada27 +refs/heads/master: e688355bfeadf17ef522b1e62cc12f8e88e69667 diff --git a/trunk/include/linux/usb/serial.h b/trunk/include/linux/usb/serial.h index 4267a9c717ba..10cb74d2ad1d 100644 --- a/trunk/include/linux/usb/serial.h +++ b/trunk/include/linux/usb/serial.h @@ -389,5 +389,20 @@ do { \ printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ } while (0) +/* + * Macro for reporting errors in write path to avoid inifinite loop + * when port is used as a console. + */ +#define dev_err_console(usport, fmt, ...) \ +do { \ + static bool __print_once; \ + struct usb_serial_port *__port = (usport); \ + \ + if (!__port->port.console || !__print_once) { \ + __print_once = true; \ + dev_err(&__port->dev, fmt, ##__VA_ARGS__); \ + } \ +} while (0) + #endif /* __LINUX_USB_SERIAL_H */