summaryrefslogtreecommitdiff
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-07-13 05:49:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-07-24 04:37:31 +0300
commite2dfa3d38797058fa03478b08bab3d3c4b081615 (patch)
tree4ebb61b80afce2fad0dca398f770db0dd3784f5a /include/linux/tty.h
parent3a6b02dc1f1b37fe2e9c86c00edf07c04bed9fab (diff)
downloadlinux-e2dfa3d38797058fa03478b08bab3d3c4b081615.tar.xz
tty: core: Add tty_debug() for printk(KERN_DEBUG) messages
Introduce tty_debug() macro to output uniform debug information for tty core debug messages (function name and tty name). Note: printk(KERN_DEBUG) is retained here over pr_debug() since messages can be enabled in non-DEBUG builds. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index ad6c8913aa3e..d072ded41678 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -709,4 +709,10 @@ static inline void proc_tty_register_driver(struct tty_driver *d) {}
static inline void proc_tty_unregister_driver(struct tty_driver *d) {}
#endif
+#define tty_debug(tty, f, args...) \
+ do { \
+ printk(KERN_DEBUG "%s: %s: " f, __func__, \
+ tty_name(tty), ##args); \
+ } while (0)
+
#endif