From: Marek Vasut Date: Fri, 21 Jul 2017 21:20:34 +0000 (+0200) Subject: net: ravb: Detect PHY correctly X-Git-Tag: v2017.09-rc2~133^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e821a7bdb13435eace82e907363dc59be56f139a;p=oweals%2Fu-boot.git net: ravb: Detect PHY correctly 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 Cc: Joe Hershberger Cc: Nobuhiro Iwamatsu Acked-by: Joe Hershberger Signed-off-by: Nobuhiro Iwamatsu --- diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c index 7f0e2568b7..ce0eacceb6 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -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 */