/* atl1_remove is called by the PCI subsystem to alert the driver that it should release a PCI device. The could be caused by a Hot-Plug event, or because the driver is going to be removed from memory.  */
static void __devexit atl1_remove(struct pci_dev *pdev)
/* atl1_remove is called by the PCI subsystem to alert the driver that it should release a PCI device. The could be caused by a Hot-Plug event, or because the driver is going to be removed from memory.  */
static void __devexit atl1_remove(struct pci_dev *pdev)
{
	struct net_device *netdev = pci_get_drvdata(pdev);
	struct atl1_adapter *adapter;
	if (!netdev)
		return;
	adapter = netdev_priv(netdev);
	if (memcmp(adapter->hw.mac_addr, adapter->hw.perm_mac_addr, ETH_ALEN)) {
		memcpy(adapter->hw.mac_addr, adapter->hw.perm_mac_addr,
			ETH_ALEN);
		atl1_set_mac_addr(&adapter->hw);
	}
	iowrite16(0, adapter->hw.hw_addr + REG_PHY_ENABLE);
	unregister_netdev(netdev);
	pci_iounmap(pdev, adapter->hw.hw_addr);
	pci_release_regions(pdev);
	free_netdev(netdev);
	pci_disable_device(pdev);
}