Skip to content

Commit

Permalink
ibm_newemac Use status property for unused/unwired EMACs
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Josh Boyer authored and Jeff Garzik committed Apr 25, 2008
1 parent 51d4a1c commit be63c09
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ibm_newemac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2562,8 +2562,11 @@ static int __devinit emac_probe(struct of_device *ofdev,
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 */
Expand Down

0 comments on commit be63c09

Please sign in to comment.