diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c b/arch/powerpc/platforms/85xx/corenet_ds.c
index c48b661..9d72e3a 100644
--- a/arch/powerpc/platforms/85xx/corenet_ds.c
+++ b/arch/powerpc/platforms/85xx/corenet_ds.c
@@ -85,8 +85,11 @@ void __init corenet_ds_setup_arch(void)
 	for_each_node_by_type(np, "pci") {
 		if (of_device_is_compatible(np, "fsl,p4080-pcie") ||
 		    of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2")) {
-			fsl_add_bridge(np, 0);
+			if (fsl_add_bridge(np, 0) < 0)
+				continue;
 			hose = pci_find_hose_for_OF_device(np);
+			if (!hose)
+				continue;
 			max = min(max, hose->dma_window_base_cur +
 					hose->dma_window_size);
 		}
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index 9ee6455..ee2ebbb 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -82,12 +82,17 @@ static void __init mpc8536_ds_setup_arch(void)
 		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
 			struct resource rsrc;
 			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == 0x8000)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
+			if ((rsrc.start & 0xfffff) == 0x8000) {
+				if (fsl_add_bridge(np, 1) < 0)
+					continue;
+			} else {
+				if (fsl_add_bridge(np, 0) < 0)
+					continue;
+			}
 
 			hose = pci_find_hose_for_OF_device(np);
+			if (!hose)
+				continue;
 			max = min(max, hose->dma_window_base_cur +
 					hose->dma_window_size);
 		}
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 2113120..5eba5f0 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -175,12 +175,17 @@ static void __init mpc85xx_ds_setup_arch(void)
 		    of_device_is_compatible(np, "fsl,p2020-pcie")) {
 			struct resource rsrc;
 			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == primary_phb_addr)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
+			if ((rsrc.start & 0xfffff) == primary_phb_addr) {
+				if (fsl_add_bridge(np, 1) < 0)
+					continue;
+			} else {
+				if (fsl_add_bridge(np, 0) < 0)
+					continue;
+			}
 
 			hose = pci_find_hose_for_OF_device(np);
+			if (!hose)
+				continue;
 			max = min(max, hose->dma_window_base_cur +
 					hose->dma_window_size);
 		}
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 495cfd9..3a68122 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -351,12 +351,17 @@ static void __init mpc85xx_mds_setup_arch(void)
 		    of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
 			struct resource rsrc;
 			of_address_to_resource(np, 0, &rsrc);
-			if ((rsrc.start & 0xfffff) == 0x8000)
-				fsl_add_bridge(np, 1);
-			else
-				fsl_add_bridge(np, 0);
+			if ((rsrc.start & 0xfffff) == 0x8000) {
+				if (fsl_add_bridge(np, 1) < 0)
+					continue;
+			} else {
+				if (fsl_add_bridge(np, 0) < 0)
+					continue;
+			}
 
 			hose = pci_find_hose_for_OF_device(np);
+			if (!hose)
+				continue;
 			max = min(max, hose->dma_window_base_cur +
 					hose->dma_window_size);
 		}
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 2bf4342..614768b 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -292,12 +292,17 @@ static void __init p1022_ds_setup_arch(void)
 
 		of_address_to_resource(np, 0, &rsrc);
 
-		if ((rsrc.start & 0xfffff) == 0x8000)
-			fsl_add_bridge(np, 1);
-		else
-			fsl_add_bridge(np, 0);
+		if ((rsrc.start & 0xfffff) == 0x8000) {
+			if (fsl_add_bridge(np, 1) < 0)
+				continue;
+		} else {
+			if (fsl_add_bridge(np, 0) < 0)
+				continue;
+		}
 
 		hose = pci_find_hose_for_OF_device(np);
+		if (!hose)
+			continue;
 		max = min(max, hose->dma_window_base_cur +
 			  hose->dma_window_size);
 	}
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 569262c..819f29b 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -83,11 +83,17 @@ mpc86xx_hpcn_setup_arch(void)
 	for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
 		struct resource rsrc;
 		of_address_to_resource(np, 0, &rsrc);
-		if ((rsrc.start & 0xfffff) == 0x8000)
-			fsl_add_bridge(np, 1);
-		else
-			fsl_add_bridge(np, 0);
+		if ((rsrc.start & 0xfffff) == 0x8000) {
+			if (fsl_add_bridge(np, 1) < 0)
+				continue;
+		} else {
+			if (fsl_add_bridge(np, 0) < 0)
+				continue;
+		}
+
 		hose = pci_find_hose_for_OF_device(np);
+		if (!hose)
+			continue;
 		max = min(max, hose->dma_window_base_cur +
 			  hose->dma_window_size);
 	}
