Skip to contentSkip to conversation

ppc32: Fix type/bug in pmac_feature.c

PATCH New Benjamin Herrenschmidt 1 participant 1 message Sep 24, 2004 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc32: Fix type/bug in pmac_feature.c

Hi !

A typo in pmac_feature.c can cause us to use a bogus node pointer when iterating the i2c controllers during boot. Fortunately, it seems that we always find the one we are looking for first, and thus never ended up in an inifinite loop here, but let's fix it and fix the warning at the same time.

===== arch/ppc/platforms/pmac_feature.c 1.26 vs edited =====

arch/ppc/platforms/pmac_feature.c +1 -1
@@ -2665,7 +2665,7 @@
 			struct device_node *p = of_get_parent(ui2c);
 			if (p && !strcmp(p->name, "uni-n"))
 				break;
-			ui2c = of_find_node_by_type(np, "i2c");
+			ui2c = of_find_node_by_type(ui2c, "i2c");
 		}
 		if (ui2c == NULL)
 			break;