Skip to contentSkip to conversation

ibm_newemac Use status property for unused/unwired EMACs

PATCH In review Benjamin Herrenschmidt 1 participant 1 message Apr 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 ibm_newemac Use status property for unused/unwired EMACs

From: Josh Boyer <[email protected]>

Convert ibm_newemac to use the of_device_is_available function when checking for unused/unwired EMACs. We leave the current check for an "unused" property to maintain backwards compatibility for older device trees. Newer device trees should simply use the standard "status" property in the EMAC node.

---

 drivers/net/ibm_newemac/core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ibm_newemac/core.c +5 -2
@@ -2562,8 +2562,11 @@ static int __devinit emac_probe(struct o
 	struct device_node **blist = NULL;
 	int err, i;
 
-	/* Skip unused/unwired EMACS */
-	if (of_get_property(np, "unused", NULL))
+	/* Skip unused/unwired EMACS.  We leave the check for an unused
+	 * property here for now, but new flat device trees should set a
+	 * status property to "disabled" instead.
+	 */
+	if (of_get_property(np, "unused", NULL) || !of_device_is_available(np))
 		return -ENODEV;
 
 	/* Find ourselves in the bootlist if we are there */