aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/hvc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/hvc')
-rw-r--r--drivers/tty/hvc/Kconfig4
-rw-r--r--drivers/tty/hvc/hvc_udbg.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig
index 8ea7f078b233..48cb8d3d1758 100644
--- a/drivers/tty/hvc/Kconfig
+++ b/drivers/tty/hvc/Kconfig
@@ -71,6 +71,10 @@ config HVC_UDBG
71 depends on PPC && EXPERIMENTAL 71 depends on PPC && EXPERIMENTAL
72 select HVC_DRIVER 72 select HVC_DRIVER
73 default n 73 default n
74 help
75 This is meant to be used during HW bring up or debugging when
76 no other console mechanism exist but udbg, to get you a quick
77 console for userspace. Do NOT enable in production kernels.
74 78
75config HVC_DCC 79config HVC_DCC
76 bool "ARM JTAG DCC console" 80 bool "ARM JTAG DCC console"
diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c
index b0957e61a7be..2259c6e72f06 100644
--- a/drivers/tty/hvc/hvc_udbg.c
+++ b/drivers/tty/hvc/hvc_udbg.c
@@ -36,7 +36,7 @@ static int hvc_udbg_put(uint32_t vtermno, const char *buf, int count)
36{ 36{
37 int i; 37 int i;
38 38
39 for (i = 0; i < count; i++) 39 for (i = 0; i < count && udbg_putc; i++)
40 udbg_putc(buf[i]); 40 udbg_putc(buf[i]);
41 41
42 return i; 42 return i;
@@ -67,6 +67,9 @@ static int __init hvc_udbg_init(void)
67{ 67{
68 struct hvc_struct *hp; 68 struct hvc_struct *hp;
69 69
70 if (!udbg_putc)
71 return -ENODEV;
72
70 BUG_ON(hvc_udbg_dev); 73 BUG_ON(hvc_udbg_dev);
71 74
72 hp = hvc_alloc(0, NO_IRQ, &hvc_udbg_ops, 16); 75 hp = hvc_alloc(0, NO_IRQ, &hvc_udbg_ops, 16);
@@ -88,6 +91,9 @@ module_exit(hvc_udbg_exit);
88 91
89static int __init hvc_udbg_console_init(void) 92static int __init hvc_udbg_console_init(void)
90{ 93{
94 if (!udbg_putc)
95 return -ENODEV;
96
91 hvc_instantiate(0, 0, &hvc_udbg_ops); 97 hvc_instantiate(0, 0, &hvc_udbg_ops);
92 add_preferred_console("hvc", 0, NULL); 98 add_preferred_console("hvc", 0, NULL);
93 99