|
@@ -114,18 +114,14 @@ int serial_console_init(void)
|
|
{
|
|
{
|
|
void *devp;
|
|
void *devp;
|
|
int rc = -1;
|
|
int rc = -1;
|
|
- char compat[MAX_PROP_LEN];
|
|
|
|
|
|
|
|
devp = serial_get_stdout_devp();
|
|
devp = serial_get_stdout_devp();
|
|
if (devp == NULL)
|
|
if (devp == NULL)
|
|
goto err_out;
|
|
goto err_out;
|
|
|
|
|
|
- if (getprop(devp, "compatible", compat, sizeof(compat)) < 0)
|
|
|
|
- goto err_out;
|
|
|
|
-
|
|
|
|
- if (!strcmp(compat, "ns16550"))
|
|
|
|
|
|
+ if (dt_is_compatible(devp, "ns16550"))
|
|
rc = ns16550_console_init(devp, &serial_cd);
|
|
rc = ns16550_console_init(devp, &serial_cd);
|
|
- else if (!strcmp(compat, "marvell,mpsc"))
|
|
|
|
|
|
+ else if (dt_is_compatible(devp, "marvell,mpsc"))
|
|
rc = mpsc_console_init(devp, &serial_cd);
|
|
rc = mpsc_console_init(devp, &serial_cd);
|
|
|
|
|
|
/* Add other serial console driver calls here */
|
|
/* Add other serial console driver calls here */
|
|
@@ -133,10 +129,12 @@ int serial_console_init(void)
|
|
if (!rc) {
|
|
if (!rc) {
|
|
console_ops.open = serial_open;
|
|
console_ops.open = serial_open;
|
|
console_ops.write = serial_write;
|
|
console_ops.write = serial_write;
|
|
- console_ops.edit_cmdline = serial_edit_cmdline;
|
|
|
|
console_ops.close = serial_close;
|
|
console_ops.close = serial_close;
|
|
console_ops.data = &serial_cd;
|
|
console_ops.data = &serial_cd;
|
|
|
|
|
|
|
|
+ if (serial_cd.getc)
|
|
|
|
+ console_ops.edit_cmdline = serial_edit_cmdline;
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
err_out:
|
|
err_out:
|