net: xilinx: Handle error value from phy_startup()
authorMichal Simek <michal.simek@xilinx.com>
Wed, 18 May 2016 10:37:22 +0000 (12:37 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 24 May 2016 11:17:55 +0000 (13:17 +0200)
Handle error returned by phy_startup() properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
drivers/net/xilinx_emaclite.c
drivers/net/zynq_gem.c

index 5862bf0a7e2d4d34d40ac4dbafab10c636b0d15c..7b85aa0463851d22e0c8f6e45f56eb11e62b59ca 100644 (file)
@@ -250,7 +250,7 @@ static void emaclite_stop(struct udevice *dev)
 
 static int setup_phy(struct udevice *dev)
 {
-       int i;
+       int i, ret;
        u16 phyreg;
        struct xemaclite *emaclite = dev_get_priv(dev);
        struct phy_device *phydev;
@@ -302,7 +302,9 @@ static int setup_phy(struct udevice *dev)
        phydev->advertising = supported;
        emaclite->phydev = phydev;
        phy_config(phydev);
-       phy_startup(phydev);
+       ret = phy_startup(phydev);
+       if (ret)
+               return ret;
 
        if (!phydev->link) {
                printf("%s: No link.\n", phydev->dev->name);
index aec8077f10b3e2b7f82e0c2bf504f5183ce89058..3704ce0dd78a58553c7b395fa909322d7957fbea 100644 (file)
@@ -360,6 +360,7 @@ static int zynq_phy_init(struct udevice *dev)
 static int zynq_gem_init(struct udevice *dev)
 {
        u32 i, nwconfig;
+       int ret;
        unsigned long clk_rate = 0;
        struct zynq_gem_priv *priv = dev_get_priv(dev);
        struct zynq_gem_regs *regs = priv->iobase;
@@ -427,7 +428,9 @@ static int zynq_gem_init(struct udevice *dev)
                priv->init++;
        }
 
-       phy_startup(priv->phydev);
+       ret = phy_startup(priv->phydev);
+       if (ret)
+               return ret;
 
        if (!priv->phydev->link) {
                printf("%s: No link.\n", priv->phydev->dev->name);