提交 c828827f 编写于 作者: S Shawn Guo 提交者: David S. Miller

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: NShawn Guo <shawn.guo@linaro.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a9b2c8ef
...@@ -996,7 +996,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) ...@@ -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 * mdio interface in board design, and need to be configured by
* fec0 mii_bus. * 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 */ /* fec1 uses fec0 mii_bus */
fep->mii_bus = fec0_mii_bus; fep->mii_bus = fec0_mii_bus;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册