/* Invoked when PCIe bus unloads AER service driver.  */
static void disable_root_aer(struct aer_rpc *rpc)
/* Invoked when PCIe bus unloads AER service driver.  */
static void disable_root_aer(struct aer_rpc *rpc)
{
	struct pci_dev *pdev = rpc->rpd->port;
	u32 reg32;
	int pos;
	set_downstream_devices_error_reporting(pdev, false);
	pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
	pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_COMMAND, 0);
	pci_read_config_dword(pdev, pos + PCI_ERR_ROOT_STATUS, &reg32);
	pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_STATUS, reg32);
}