From: Hugh Blemings Date: Wed, 5 Dec 2007 00:14:30 +0000 (+1100) Subject: ibm_newemac: Skip EMACs that are marked unused by the firmware X-Git-Tag: v2.6.24-rc5~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d722562d734834282bccd97e0badd213ec311e9;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git ibm_newemac: Skip EMACs that are marked unused by the firmware Depending on how the 44x processors are wired, some EMAC cells might not be useable (and not connected to a PHY). However, some device-trees may choose to still expose them (since their registers are present in the MMIO space) but with an "unused" property in them. Signed-off-by: Hugh Blemings Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index ac9fd46..a77207f 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c @@ -2550,6 +2550,10 @@ 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)) + return -ENODEV; + /* Find ourselves in the bootlist if we are there */ for (i = 0; i < EMAC_BOOT_LIST_SIZE; i++) if (emac_boot_list[i] == np)