TI DaVinci EMAC: Handle emac module clock correctly.

In the driver probe function the emac module clock needs to
be enabled before calling register_netdev(). As soon as the
device is registered the driver get_stats function can be invoked
by the core - the module clock must be switched on to be able to
read from stats registers. Also explicitly call matching clk_disable
for failure conditions in probe function.

Signed-off-by: Sriramakrishnan <srk@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Sriram and committed by David S. Miller 1ca518b6 4d907069

+3 -1
+3 -1
drivers/net/davinci_emac.c
··· 2711 2711 SET_ETHTOOL_OPS(ndev, &ethtool_ops); 2712 2712 netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT); 2713 2713 2714 + clk_enable(emac_clk); 2715 + 2714 2716 /* register the network device */ 2715 2717 SET_NETDEV_DEV(ndev, &pdev->dev); 2716 2718 rc = register_netdev(ndev); ··· 2722 2720 goto netdev_reg_err; 2723 2721 } 2724 2722 2725 - clk_enable(emac_clk); 2726 2723 2727 2724 /* MII/Phy intialisation, mdio bus registration */ 2728 2725 emac_mii = mdiobus_alloc(); ··· 2761 2760 2762 2761 netdev_reg_err: 2763 2762 mdio_alloc_err: 2763 + clk_disable(emac_clk); 2764 2764 no_irq_res: 2765 2765 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2766 2766 release_mem_region(res->start, res->end - res->start + 1);