target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
static int edma_axi_remove(struct platform_device *pdev)
{
	struct edma_adapter *adapter = netdev_priv(edma_netdev[0]);
	struct edma_common_info *edma_cinfo = adapter->edma_cinfo;
	struct edma_hw *hw = &edma_cinfo->hw;
	int i;

	for (i = 0; i < edma_cinfo->num_gmac; i++)
		unregister_netdev(edma_netdev[i]);

	edma_stop_rx_tx(hw);
	for (i = 0; i < CONFIG_NR_CPUS; i++)
		napi_disable(&edma_cinfo->edma_percpu_info[i].napi);

	edma_irq_disable(edma_cinfo);
	edma_write_reg(EDMA_REG_RX_ISR, 0xff);
	edma_write_reg(EDMA_REG_TX_ISR, 0xffff);
#ifdef CONFIG_RFS_ACCEL
	for (i = 0; i < edma_cinfo->num_gmac; i++) {
		free_irq_cpu_rmap(edma_netdev[i]->rx_cpu_rmap);
		edma_netdev[i]->rx_cpu_rmap = NULL;
	}
#endif

	for (i = 0; i < edma_cinfo->num_gmac; i++) {
		struct edma_adapter *adapter = netdev_priv(edma_netdev[i]);

		if (adapter->phydev)
			phy_disconnect(adapter->phydev);
	}

	del_timer_sync(&edma_cinfo->edma_stats_timer);
	edma_free_irqs(adapter);
	unregister_net_sysctl_table(edma_cinfo->edma_ctl_table_hdr);
	iounmap(edma_cinfo->ess_hw_addr);
	clk_disable_unprepare(edma_cinfo->ess_clk);
	edma_free_tx_resources(edma_cinfo);
	edma_free_rx_resources(edma_cinfo);
	edma_free_tx_rings(edma_cinfo);
	edma_free_rx_rings(edma_cinfo);
	edma_free_queues(edma_cinfo);
	for (i = 0; i < edma_cinfo->num_gmac; i++)
		free_netdev(edma_netdev[i]);

	kfree(edma_cinfo);

	return 0;
}
/* edma_axi_remove()
 *	Device Removal Routine
 *
 * edma_axi_remove is called by the platform subsystem to alert the driver
 * that it should release a platform device.
 */
edma_axi_remove()
Device Removal Routine

edma_axi_remove is called by the platform subsystem to alert the driver
that it should release a platform device.
edma_axi_remove () Device Removal Routine edma_axi_remove is called by the platform subsystem to alert the driver that it should release a platform device .
static int edma_axi_remove(struct platform_device *pdev)
{
	struct edma_adapter *adapter = netdev_priv(edma_netdev[0]);
	struct edma_common_info *edma_cinfo = adapter->edma_cinfo;
	struct edma_hw *hw = &edma_cinfo->hw;
	int i;
	for (i = 0; i < edma_cinfo->num_gmac; i++)
		unregister_netdev(edma_netdev[i]);
	edma_stop_rx_tx(hw);
	for (i = 0; i < CONFIG_NR_CPUS; i++)
		napi_disable(&edma_cinfo->edma_percpu_info[i].napi);
	edma_irq_disable(edma_cinfo);
	edma_write_reg(EDMA_REG_RX_ISR, 0xff);
	edma_write_reg(EDMA_REG_TX_ISR, 0xffff);
#ifdef CONFIG_RFS_ACCEL
	for (i = 0; i < edma_cinfo->num_gmac; i++) {
		free_irq_cpu_rmap(edma_netdev[i]->rx_cpu_rmap);
		edma_netdev[i]->rx_cpu_rmap = NULL;
	}
#endif
	for (i = 0; i < edma_cinfo->num_gmac; i++) {
		struct edma_adapter *adapter = netdev_priv(edma_netdev[i]);
		if (adapter->phydev)
			phy_disconnect(adapter->phydev);
	}
	del_timer_sync(&edma_cinfo->edma_stats_timer);
	edma_free_irqs(adapter);
	unregister_net_sysctl_table(edma_cinfo->edma_ctl_table_hdr);
	iounmap(edma_cinfo->ess_hw_addr);
	clk_disable_unprepare(edma_cinfo->ess_clk);
	edma_free_tx_resources(edma_cinfo);
	edma_free_rx_resources(edma_cinfo);
	edma_free_tx_rings(edma_cinfo);
	edma_free_rx_rings(edma_cinfo);
	edma_free_queues(edma_cinfo);
	for (i = 0; i < edma_cinfo->num_gmac; i++)
		free_netdev(edma_netdev[i]);
	kfree(edma_cinfo);
	return 0;
}
static int edma_axi_remove ( struct platform_device * pdev ) { struct edma_adapter * adapter = netdev_priv ( edma_netdev [ 0 ] ) ; struct edma_common_info * edma_cinfo = adapter -> edma_cinfo ; struct edma_hw * hw = & edma_cinfo -> hw ; int i ; for ( i = 0 ; i < edma_cinfo -> num_gmac ; i ++ ) unregister_netdev ( edma_netdev [ i ] ) ; edma_stop_rx_tx ( hw ) ; for ( i = 0 ; i < CONFIG_NR_CPUS ; i ++ ) napi_disable ( & edma_cinfo -> edma_percpu_info [ i ] . napi ) ; edma_irq_disable ( edma_cinfo ) ; edma_write_reg ( EDMA_REG_RX_ISR , 0xff ) ; edma_write_reg ( EDMA_REG_TX_ISR , 0xffff ) ; #ifdef CONFIG_RFS_ACCEL for ( i = 0 ; i < edma_cinfo -> num_gmac ; i ++ ) { free_irq_cpu_rmap ( edma_netdev [ i ] -> rx_cpu_rmap ) ; edma_netdev [ i ] -> rx_cpu_rmap = NULL ; } #endif for ( i = 0 ; i < edma_cinfo -> num_gmac ; i ++ ) { struct edma_adapter * adapter = netdev_priv ( edma_netdev [ i ] ) ; if ( adapter -> phydev ) phy_disconnect ( adapter -> phydev ) ; } del_timer_sync ( & edma_cinfo -> edma_stats_timer ) ; edma_free_irqs ( adapter ) ; unregister_net_sysctl_table ( edma_cinfo -> edma_ctl_table_hdr ) ; iounmap ( edma_cinfo -> ess_hw_addr ) ; clk_disable_unprepare ( edma_cinfo -> ess_clk ) ; edma_free_tx_resources ( edma_cinfo ) ; edma_free_rx_resources ( edma_cinfo ) ; edma_free_tx_rings ( edma_cinfo ) ; edma_free_rx_rings ( edma_cinfo ) ; edma_free_queues ( edma_cinfo ) ; for ( i = 0 ; i < edma_cinfo -> num_gmac ; i ++ ) free_netdev ( edma_netdev [ i ] ) ; kfree ( edma_cinfo ) ; return 0 ; }
edma_axi_remove()
      Device Removal Routine
edma_axi_remove () Device Removal Routine