/* Called when removing the device driver. We disable clock usage and release the resources taken up by the driver and unregister network device  */
static int __devexit davinci_emac_remove(struct platform_device *pdev)
/* Called when removing the device driver. We disable clock usage and release the resources taken up by the driver and unregister network device  */
static int __devexit davinci_emac_remove(struct platform_device *pdev)
{
	struct resource *res;
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct emac_priv *priv = netdev_priv(ndev);
	dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n");
	platform_set_drvdata(pdev, NULL);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	mdiobus_unregister(priv->mii_bus);
	mdiobus_free(priv->mii_bus);
	release_mem_region(res->start, res->end - res->start + 1);
	unregister_netdev(ndev);
	free_netdev(ndev);
	iounmap(priv->remap_addr);
	clk_disable(emac_clk);
	clk_put(emac_clk);
	return 0;
}