net: ravb: Detect PHY correctly
authorMarek Vasut <marek.vasut@gmail.com>
Fri, 21 Jul 2017 21:20:34 +0000 (23:20 +0200)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Wed, 2 Aug 2017 19:26:25 +0000 (04:26 +0900)
The order of parameters passed to the phy_connect() was wrong.
Moreover, only PHY address 0 was used. Replace this with code
capable of detecting the PHY address.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/net/ravb.c

index 7f0e2568b76b2c6225c3f722262a48a5699a5f98..ce0eacceb60adcfd51533f6bed972c0d3dc5d047 100644 (file)
@@ -298,13 +298,14 @@ static int ravb_phy_config(struct udevice *dev)
        struct ravb_priv *eth = dev_get_priv(dev);
        struct eth_pdata *pdata = dev_get_platdata(dev);
        struct phy_device *phydev;
-       int reg;
+       int mask = 0xffffffff, reg;
 
-       phydev = phy_connect(eth->bus, pdata->phy_interface,
-                            dev, PHY_INTERFACE_MODE_RGMII_ID);
+       phydev = phy_find_by_mask(eth->bus, mask, pdata->phy_interface);
        if (!phydev)
                return -ENODEV;
 
+       phy_connect_dev(phydev, dev);
+
        eth->phydev = phydev;
 
        /* 10BASE is not supported for Ethernet AVB MAC */