]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
net: phy: Test previous phydev->dev against new mac dev
authorBin Meng <bmeng.cn@gmail.com>
Thu, 8 Oct 2015 04:19:31 +0000 (21:19 -0700)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 29 Oct 2015 19:05:49 +0000 (14:05 -0500)
In phy_connect_dev(), if the phy device has an accociated mac device
before, a warning message will be printed. But we should test the
old device against the new one, if they are actually the same one,
don't print the warning message.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/phy.c

index d0b3e8523fcdc94bbd20f512e134aab246228bc6..d7364ffc34f2f1774b38153600698451de549d68 100644 (file)
@@ -789,7 +789,7 @@ void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev)
 {
        /* Soft Reset the PHY */
        phy_reset(phydev);
-       if (phydev->dev) {
+       if (phydev->dev && phydev->dev != dev) {
                printf("%s:%d is connected to %s.  Reconnecting to %s\n",
                                phydev->bus->name, phydev->addr,
                                phydev->dev->name, dev->name);