linux/drivers/net/ethernet/ti/davinci_emac.c
/**
 * davinci_emac_remove - EMAC device remove
 * @pdev: The DaVinci EMAC device that we are removing
 *
 * Called when removing the device driver. We disable clock usage and release
 * the resources taken up by the driver and unregister network device
 */
EMAC device remove
@pdev: The DaVinci EMAC device that we are removing

Called when removing the device driver. We disable clock usage and release
the resources taken up by the driver and unregister network device
EMAC device remove @pdev : The DaVinci EMAC device that we are removing 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 davinci_emac_remove(struct platform_device *pdev)
{
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct emac_priv *priv = netdev_priv(ndev);
	struct device_node *np = pdev->dev.of_node;
	dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n");
	if (priv->txchan)
		cpdma_chan_destroy(priv->txchan);
	if (priv->rxchan)
		cpdma_chan_destroy(priv->rxchan);
	cpdma_ctlr_destroy(priv->dma);
	unregister_netdev(ndev);
	of_node_put(priv->phy_node);
	pm_runtime_disable(&pdev->dev);
	if (of_phy_is_fixed_link(np))
		of_phy_deregister_fixed_link(np);
	free_netdev(ndev);
	return 0;
}
static int davinci_emac_remove ( struct platform_device * pdev ) { struct net_device * ndev = platform_get_drvdata ( pdev ) ; struct emac_priv * priv = netdev_priv ( ndev ) ; struct device_node * np = pdev -> dev . of_node ; dev_notice ( & ndev -> dev , " \n " ) ; if ( priv -> txchan ) cpdma_chan_destroy ( priv -> txchan ) ; if ( priv -> rxchan ) cpdma_chan_destroy ( priv -> rxchan ) ; cpdma_ctlr_destroy ( priv -> dma ) ; unregister_netdev ( ndev ) ; of_node_put ( priv -> phy_node ) ; pm_runtime_disable ( & pdev -> dev ) ; if ( of_phy_is_fixed_link ( np ) ) of_phy_deregister_fixed_link ( np ) ; free_netdev ( ndev ) ; return 0 ; }
davinci_emac_remove - EMAC device remove
 @pdev: The DaVinci EMAC device that we are removing
davinci_emac_remove - EMAC device remove @pdev : The DaVinci EMAC device that we are removing