aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-09-22 22:12:47 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-23 13:55:26 -0400
commitc828827f8426f2cd8e37315c59ae406534a16d48 (patch)
treebed57a3190f377d9aa5846ab85a949ff2a321a76 /drivers/net
parenta9b2c8ef1585e1f14cec03777b1238e0d5ec4ea1 (diff)
net/fec: fix fec1 check in fec_enet_mii_init()
In function fec_enet_mii_init(), it uses non-zero pdev->id as part of the condition to check the second fec instance (fec1). This works before the driver supports device tree probe. But in case of device tree probe, pdev->id is -1 which is also non-zero, so the logic becomes broken when device tree probe gets supported. The patch change the logic to check "pdev->id > 0" as the part of the condition for identifying fec1. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/freescale/fec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 9c1d0594895..2bbe6a519bf 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -996,7 +996,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
996 * mdio interface in board design, and need to be configured by 996 * mdio interface in board design, and need to be configured by
997 * fec0 mii_bus. 997 * fec0 mii_bus.
998 */ 998 */
999 if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) { 999 if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) {
1000 /* fec1 uses fec0 mii_bus */ 1000 /* fec1 uses fec0 mii_bus */
1001 fep->mii_bus = fec0_mii_bus; 1001 fep->mii_bus = fec0_mii_bus;
1002 return 0; 1002 return 0;