]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: phy: Fix return value check phy_probe
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Mon, 4 Mar 2019 15:02:11 +0000 (16:02 +0100)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 8 May 2019 22:27:00 +0000 (17:27 -0500)
Don't ignore return value of phy_probe() call as
the probe may fail and it needs to be reported.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/phy.c

index 04af916678622b153bb5ae1276eb1e5a1022d5ca..c1c1af9abdbe9a8a60c4de06bfea921fd6b3df12 100644 (file)
@@ -671,7 +671,10 @@ static struct phy_device *phy_device_create(struct mii_dev *bus, int addr,
 
        dev->drv = get_phy_driver(dev, interface);
 
-       phy_probe(dev);
+       if (phy_probe(dev)) {
+               printf("%s, PHY probe failed\n", __func__);
+               return NULL;
+       }
 
        if (addr >= 0 && addr < PHY_MAX_ADDR)
                bus->phymap[addr] = dev;