/* Report an EEH error to each device driver, collect up and merge the device driver responses. Cumulative response passed back in "userdata".  */
static int eeh_report_error(struct pci_dev *dev, void *userdata)
/* Report an EEH error to each device driver, collect up and merge the device driver responses. Cumulative response passed back in "userdata".  */
static int eeh_report_error(struct pci_dev *dev, void *userdata)
{
	enum pci_ers_result rc, *res = userdata;
	struct pci_driver *driver = dev->driver;
	dev->error_state = pci_channel_io_frozen;
	if (!driver)
		return 0;
	eeh_disable_irq(dev);
	if (!driver->err_handler ||
	    !driver->err_handler->error_detected)
		return 0;
	rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen);
	if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
	if (*res == PCI_ERS_RESULT_NONE) *res = rc;
	return 0;
}