/* Invoked when PCI Express bus unloads or AER probe fails.  */
static void aer_remove(struct pcie_device *dev)
/* Invoked when PCI Express bus unloads or AER probe fails.  */
static void aer_remove(struct pcie_device *dev)
{
	struct aer_rpc *rpc = get_service_data(dev);
	if (rpc) {
		if (rpc->isr)
			free_irq(dev->irq, dev);
		wait_event(rpc->wait_release, rpc->prod_idx == rpc->cons_idx);
		aer_delete_rootport(rpc);
		set_service_data(dev, NULL);
	}
}