diff options
-rw-r--r-- | arch/powerpc/boot/serial.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c index eaa0d3ae3518..3ce7f651ab34 100644 --- a/arch/powerpc/boot/serial.c +++ b/arch/powerpc/boot/serial.c | |||
@@ -114,18 +114,14 @@ int serial_console_init(void) | |||
114 | { | 114 | { |
115 | void *devp; | 115 | void *devp; |
116 | int rc = -1; | 116 | int rc = -1; |
117 | char compat[MAX_PROP_LEN]; | ||
118 | 117 | ||
119 | devp = serial_get_stdout_devp(); | 118 | devp = serial_get_stdout_devp(); |
120 | if (devp == NULL) | 119 | if (devp == NULL) |
121 | goto err_out; | 120 | goto err_out; |
122 | 121 | ||
123 | if (getprop(devp, "compatible", compat, sizeof(compat)) < 0) | 122 | if (dt_is_compatible(devp, "ns16550")) |
124 | goto err_out; | ||
125 | |||
126 | if (!strcmp(compat, "ns16550")) | ||
127 | rc = ns16550_console_init(devp, &serial_cd); | 123 | rc = ns16550_console_init(devp, &serial_cd); |
128 | else if (!strcmp(compat, "marvell,mpsc")) | 124 | else if (dt_is_compatible(devp, "marvell,mpsc")) |
129 | rc = mpsc_console_init(devp, &serial_cd); | 125 | rc = mpsc_console_init(devp, &serial_cd); |
130 | 126 | ||
131 | /* Add other serial console driver calls here */ | 127 | /* Add other serial console driver calls here */ |
@@ -133,10 +129,12 @@ int serial_console_init(void) | |||
133 | if (!rc) { | 129 | if (!rc) { |
134 | console_ops.open = serial_open; | 130 | console_ops.open = serial_open; |
135 | console_ops.write = serial_write; | 131 | console_ops.write = serial_write; |
136 | console_ops.edit_cmdline = serial_edit_cmdline; | ||
137 | console_ops.close = serial_close; | 132 | console_ops.close = serial_close; |
138 | console_ops.data = &serial_cd; | 133 | console_ops.data = &serial_cd; |
139 | 134 | ||
135 | if (serial_cd.getc) | ||
136 | console_ops.edit_cmdline = serial_edit_cmdline; | ||
137 | |||
140 | return 0; | 138 | return 0; |
141 | } | 139 | } |
142 | err_out: | 140 | err_out: |