net: xilinx: Handle error value from phy_startup()

Handle error returned by phy_startup() properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
Michal Simek 2016-05-18 12:37:22 +02:00
parent ed0cea7c52
commit 55259e7cda
2 changed files with 8 additions and 3 deletions

View file

@ -250,7 +250,7 @@ static void emaclite_stop(struct udevice *dev)
static int setup_phy(struct udevice *dev) static int setup_phy(struct udevice *dev)
{ {
int i; int i, ret;
u16 phyreg; u16 phyreg;
struct xemaclite *emaclite = dev_get_priv(dev); struct xemaclite *emaclite = dev_get_priv(dev);
struct phy_device *phydev; struct phy_device *phydev;
@ -302,7 +302,9 @@ static int setup_phy(struct udevice *dev)
phydev->advertising = supported; phydev->advertising = supported;
emaclite->phydev = phydev; emaclite->phydev = phydev;
phy_config(phydev); phy_config(phydev);
phy_startup(phydev); ret = phy_startup(phydev);
if (ret)
return ret;
if (!phydev->link) { if (!phydev->link) {
printf("%s: No link.\n", phydev->dev->name); printf("%s: No link.\n", phydev->dev->name);

View file

@ -360,6 +360,7 @@ static int zynq_phy_init(struct udevice *dev)
static int zynq_gem_init(struct udevice *dev) static int zynq_gem_init(struct udevice *dev)
{ {
u32 i, nwconfig; u32 i, nwconfig;
int ret;
unsigned long clk_rate = 0; unsigned long clk_rate = 0;
struct zynq_gem_priv *priv = dev_get_priv(dev); struct zynq_gem_priv *priv = dev_get_priv(dev);
struct zynq_gem_regs *regs = priv->iobase; struct zynq_gem_regs *regs = priv->iobase;
@ -427,7 +428,9 @@ static int zynq_gem_init(struct udevice *dev)
priv->init++; priv->init++;
} }
phy_startup(priv->phydev); ret = phy_startup(priv->phydev);
if (ret)
return ret;
if (!priv->phydev->link) { if (!priv->phydev->link) {
printf("%s: No link.\n", priv->phydev->dev->name); printf("%s: No link.\n", priv->phydev->dev->name);