Patchwork [6/8] powerpc: Check "status" property before adding legacy ISA serial ports

login
register
mail settings
Submitter Benjamin Herrenschmidt
Date July 15, 2013, 3:03 a.m.
Message ID <1373857395-2084-6-git-send-email-benh@kernel.crashing.org>
Download mbox | patch
Permalink /patch/258939/
State Accepted, archived
Commit e0f5fa99a378d6910d234f3c8998aebfe2f54745
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Benjamin Herrenschmidt - July 15, 2013, 3:03 a.m.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/legacy_serial.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 5cf11b0..6f2a15c 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -386,9 +386,11 @@  void __init find_legacy_serial_ports(void)
 		struct device_node *isa = of_get_parent(np);
 		if (isa && (!strcmp(isa->name, "isa") ||
 			    !strcmp(isa->name, "lpc"))) {
-			index = add_legacy_isa_port(np, isa);
-			if (index >= 0 && np == stdout)
-				legacy_serial_console = index;
+			if (of_device_is_available(np)) {
+				index = add_legacy_isa_port(np, isa);
+				if (index >= 0 && np == stdout)
+					legacy_serial_console = index;
+			}
 		}
 		of_node_put(isa);
 	}