aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/xilinx/xilinx_emaclite.c
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2013-05-29 20:28:03 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-30 20:08:43 -0400
commitccfecdfe16a872ed3e8322ea48e34502568eb849 (patch)
treebc71ffd067ad05024bedaf4518abc40e78ae9c08 /drivers/net/ethernet/xilinx/xilinx_emaclite.c
parentcafe89024bd0b1bd088f4c539bcc980cb37c7ce5 (diff)
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>
Diffstat (limited to 'drivers/net/ethernet/xilinx/xilinx_emaclite.c')
-rw-r--r--drivers/net/ethernet/xilinx/xilinx_emaclite.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 919b983114e9..a16dc3508998 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -852,8 +852,10 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
852 /* Don't register the MDIO bus if the phy_node or its parent node 852 /* Don't register the MDIO bus if the phy_node or its parent node
853 * can't be found. 853 * can't be found.
854 */ 854 */
855 if (!np) 855 if (!np) {
856 dev_err(dev, "Failed to register mdio bus.\n");
856 return -ENODEV; 857 return -ENODEV;
858 }
857 859
858 /* Enable the MDIO bus by asserting the enable bit in MDIO Control 860 /* Enable the MDIO bus by asserting the enable bit in MDIO Control
859 * register. 861 * register.
@@ -862,8 +864,10 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
862 XEL_MDIOCTRL_MDIOEN_MASK); 864 XEL_MDIOCTRL_MDIOEN_MASK);
863 865
864 bus = mdiobus_alloc(); 866 bus = mdiobus_alloc();
865 if (!bus) 867 if (!bus) {
868 dev_err(dev, "Failed to allocal mdiobus\n");
866 return -ENOMEM; 869 return -ENOMEM;
870 }
867 871
868 of_address_to_resource(np, 0, &res); 872 of_address_to_resource(np, 0, &res);
869 snprintf(bus->id, MII_BUS_ID_SIZE, "%.8llx", 873 snprintf(bus->id, MII_BUS_ID_SIZE, "%.8llx",
@@ -879,8 +883,10 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
879 lp->mii_bus = bus; 883 lp->mii_bus = bus;
880 884
881 rc = of_mdiobus_register(bus, np); 885 rc = of_mdiobus_register(bus, np);
882 if (rc) 886 if (rc) {
887 dev_err(dev, "Failed to register mdio bus.\n");
883 goto err_register; 888 goto err_register;
889 }
884 890
885 return 0; 891 return 0;
886 892