return old;
}
+static bool eeh_dev_removed(struct eeh_dev *edev)
+{
+ return !edev || (edev->mode & EEH_DEV_REMOVED);
+}
+
+static bool eeh_edev_actionable(struct eeh_dev *edev)
+{
+ return (edev->pdev && !eeh_dev_removed(edev) &&
+ !eeh_pe_passed(edev->pe));
+}
+
/**
* eeh_pcid_get - Get the PCI device driver
* @pdev: PCI device
}
}
-static bool eeh_dev_removed(struct eeh_dev *edev)
-{
- /* EEH device removed ? */
- if (!edev || (edev->mode & EEH_DEV_REMOVED))
- return true;
-
- return false;
-}
-
static void *eeh_dev_save_state(struct eeh_dev *edev, void *userdata)
{
struct pci_dev *pdev;
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;
- if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ if (!eeh_edev_actionable(edev))
return NULL;
device_lock(&dev->dev);
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;
- if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ if (!eeh_edev_actionable(edev))
return NULL;
device_lock(&dev->dev);
enum pci_ers_result rc, *res = userdata;
struct pci_driver *driver;
- if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ if (!eeh_edev_actionable(edev))
return NULL;
device_lock(&dev->dev);
bool was_in_error;
struct pci_driver *driver;
- if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ if (!eeh_edev_actionable(edev))
return NULL;
device_lock(&dev->dev);
struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
struct pci_driver *driver;
- if (!dev || eeh_dev_removed(edev) || eeh_pe_passed(edev->pe))
+ if (!eeh_edev_actionable(edev))
return NULL;
device_lock(&dev->dev);