net: emaclite: Report failures in mdio setup

Be more verbose when any problem happens.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Michal Simek 2013-05-30 00:28:03 +00:00 committed by David S. Miller
parent cafe89024b
commit ccfecdfe16
1 changed files with 9 additions and 3 deletions

View File

@ -852,8 +852,10 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
/* Don't register the MDIO bus if the phy_node or its parent node /* Don't register the MDIO bus if the phy_node or its parent node
* can't be found. * can't be found.
*/ */
if (!np) if (!np) {
dev_err(dev, "Failed to register mdio bus.\n");
return -ENODEV; return -ENODEV;
}
/* Enable the MDIO bus by asserting the enable bit in MDIO Control /* Enable the MDIO bus by asserting the enable bit in MDIO Control
* register. * register.
@ -862,8 +864,10 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
XEL_MDIOCTRL_MDIOEN_MASK); XEL_MDIOCTRL_MDIOEN_MASK);
bus = mdiobus_alloc(); bus = mdiobus_alloc();
if (!bus) if (!bus) {
dev_err(dev, "Failed to allocal mdiobus\n");
return -ENOMEM; return -ENOMEM;
}
of_address_to_resource(np, 0, &res); of_address_to_resource(np, 0, &res);
snprintf(bus->id, MII_BUS_ID_SIZE, "%.8llx", snprintf(bus->id, MII_BUS_ID_SIZE, "%.8llx",
@ -879,8 +883,10 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
lp->mii_bus = bus; lp->mii_bus = bus;
rc = of_mdiobus_register(bus, np); rc = of_mdiobus_register(bus, np);
if (rc) if (rc) {
dev_err(dev, "Failed to register mdio bus.\n");
goto err_register; goto err_register;
}
return 0; return 0;