]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'pci/tejun-workqueue' into next
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 14 Sep 2012 18:08:40 +0000 (12:08 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 14 Sep 2012 18:08:40 +0000 (12:08 -0600)
* pci/tejun-workqueue:
  PCI: Rewrite pci_call_probe() to use workqueue instead of work_on_cpu()

Conflicts:
drivers/pci/pci-driver.c

1  2 
drivers/pci/pci-driver.c

index d6fd6b6d9d4b575c26eb0041e503ddb10ddb9d64,0be142844cee5b2861e0875f5e2b07512106371e..8f87ea085a9f9341f614583f1c9a6d30e5754f8c
@@@ -274,18 -274,17 +274,21 @@@ struct drv_dev_and_id 
        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,