/* stmmac_dvr_remove @pdev: platform device pointer Description: this function resets the TX/RX processes, disables the MAC RX/TX changes the link status, releases the DMA descriptor rings, unregisters the MDIO bus and unmaps the allocated memory.  */
static int stmmac_dvr_remove(struct platform_device *pdev)
/* stmmac_dvr_remove @pdev: platform device pointer Description: this function resets the TX/RX processes, disables the MAC RX/TX changes the link status, releases the DMA descriptor rings, unregisters the MDIO bus and unmaps the allocated memory.  */
static int stmmac_dvr_remove(struct platform_device *pdev)
{
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct resource *res;
	pr_info("%s:\n\tremoving driver", __func__);
	stmmac_dma_stop_rx(ndev->base_addr);
	stmmac_dma_stop_tx(ndev->base_addr);
	stmmac_mac_disable_rx(ndev->base_addr);
	stmmac_mac_disable_tx(ndev->base_addr);
	netif_carrier_off(ndev);
	stmmac_mdio_unregister(ndev);
	platform_set_drvdata(pdev, NULL);
	unregister_netdev(ndev);
	iounmap((void *)ndev->base_addr);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	release_mem_region(res->start, (res->end - res->start));
	free_netdev(ndev);
	return 0;
}