struct pci_driver *drv;
struct pci_dev *dev;
const struct pci_device_id *id;
+ struct work_struct work;
+ int error;
};
- static long local_pci_probe(void *_ddi)
+ static void pci_probe_fn(struct work_struct *work)
{
- struct drv_dev_and_id *ddi = _ddi;
+ struct drv_dev_and_id *ddi = container_of(work, struct drv_dev_and_id,
+ work);
struct device *dev = &ddi->dev->dev;
+ struct device *parent = dev->parent;
int rc;
+ /* The parent bridge must be in active state when probing */
+ if (parent)
+ pm_runtime_get_sync(parent);
/* Unbound PCI devices are always set to disabled and suspended.
* During probe, the device is set to enabled and active and the
* usage count is incremented. If the driver supports runtime PM,
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
}
- return rc;
+ if (parent)
+ pm_runtime_put(parent);
+
+ ddi->error = rc;
}
static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,