Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dc4f397d6e385c4ea0fe9732df911a86f1a78c9a
Commit:     dc4f397d6e385c4ea0fe9732df911a86f1a78c9a
Parent:     61d3b949b70802c4f32d540b11a93128c31c67ea
Author:     Scott Wood <[EMAIL PROTECTED]>
AuthorDate: Tue Aug 21 03:39:54 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed Aug 22 15:21:48 2007 +1000

    [POWERPC] bootwrapper: serial_console_init() fixes
    
    1. Search the entire compatible list for serial devices.
    
    The serial code previously did a simple strcmp on the compatible
    node; this fails when the match string is not the first compatible
    listed.  Use dt_is_compatible() instead.
    
    2. Don't call serial_edit_cmdline if getc isn't defined.
    
    Signed-off-by: Scott Wood <[EMAIL PROTECTED]>
    Acked-by: David Gibson <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 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 eaa0d3a..3ce7f65 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -114,18 +114,14 @@ int serial_console_init(void)
 {
        void *devp;
        int rc = -1;
-       char compat[MAX_PROP_LEN];
 
        devp = serial_get_stdout_devp();
        if (devp == NULL)
                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);
-       else if (!strcmp(compat, "marvell,mpsc"))
+       else if (dt_is_compatible(devp, "marvell,mpsc"))
                rc = mpsc_console_init(devp, &serial_cd);
 
        /* Add other serial console driver calls here */
@@ -133,10 +129,12 @@ int serial_console_init(void)
        if (!rc) {
                console_ops.open = serial_open;
                console_ops.write = serial_write;
-               console_ops.edit_cmdline = serial_edit_cmdline;
                console_ops.close = serial_close;
                console_ops.data = &serial_cd;
 
+               if (serial_cd.getc)
+                       console_ops.edit_cmdline = serial_edit_cmdline;
+
                return 0;
        }
 err_out:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to