From: Shawn Guo Date: Fri, 23 Sep 2011 02:12:47 +0000 (+0000) Subject: net/fec: fix fec1 check in fec_enet_mii_init() X-Git-Tag: MMI-PSA29.97-13-9~18194^2~223 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c828827f8426f2cd8e37315c59ae406534a16d48;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 9c1d0594895c..2bbe6a519bf4 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) * mdio interface in board design, and need to be configured by * fec0 mii_bus. */ - if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id) { + if ((id_entry->driver_data & FEC_QUIRK_ENET_MAC) && pdev->id > 0) { /* fec1 uses fec0 mii_bus */ fep->mii_bus = fec0_mii_bus; return 0;