net: fec_mxc: autodetect PHY address if phy_id < 0
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 9 Oct 2015 09:00:32 +0000 (11:00 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 9 Oct 2015 09:00:32 +0000 (11:00 +0200)
drivers/net/fec_mxc.c

index 1ef3456..343646c 100644 (file)
@@ -1106,7 +1106,8 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
        if (!bus)
                return -ENOMEM;
 #ifdef CONFIG_PHYLIB
-       phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
+       phydev = phy_find_by_mask(bus, phy_id < 0 ? 0xff : (1 << phy_id),
+                               PHY_INTERFACE_MODE_RGMII);
        if (!phydev) {
                free(bus);
                return -ENOMEM;