diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-11-06 18:26:48 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-11-06 18:26:48 -0500 |
commit | c245f2422031fec447e4d9e35fb0ef0fd5e42ab9 (patch) | |
tree | da3b30682401c44e3b8c55ec05e374c48ba5f14a /drivers/pci/pci-driver.c | |
parent | 589a1b076ff9b6f84184507ec303229b3df20658 (diff) | |
parent | f92d74c1f5afaff7cd1ea14ade8f1ba6b519e422 (diff) |
Merge branch 'pci/misc' into next
* pci/misc:
PCI: Warn on driver probe return value greater than zero
PCI: Drop warning about drivers that don't use pci_set_master()
PCI: Workaround missing pci_set_master in pci drivers
PCI: Update pcie_ports 'auto' behavior for non-ACPI platforms
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 840fdc5ba0d8..454853507b7e 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -267,11 +267,19 @@ static long local_pci_probe(void *_ddi) | |||
267 | pm_runtime_get_sync(dev); | 267 | pm_runtime_get_sync(dev); |
268 | pci_dev->driver = pci_drv; | 268 | pci_dev->driver = pci_drv; |
269 | rc = pci_drv->probe(pci_dev, ddi->id); | 269 | rc = pci_drv->probe(pci_dev, ddi->id); |
270 | if (rc) { | 270 | if (!rc) |
271 | return rc; | ||
272 | if (rc < 0) { | ||
271 | pci_dev->driver = NULL; | 273 | pci_dev->driver = NULL; |
272 | pm_runtime_put_sync(dev); | 274 | pm_runtime_put_sync(dev); |
275 | return rc; | ||
273 | } | 276 | } |
274 | return rc; | 277 | /* |
278 | * Probe function should return < 0 for failure, 0 for success | ||
279 | * Treat values > 0 as success, but warn. | ||
280 | */ | ||
281 | dev_warn(dev, "Driver probe function unexpectedly returned %d\n", rc); | ||
282 | return 0; | ||
275 | } | 283 | } |
276 | 284 | ||
277 | static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, | 285 | static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, |