summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-12-31 19:06:35 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-31 12:00:45 -0800
commit5b889bf237fca383b5807ad69fde3ad1e2287e42 (patch)
tree91c1df6fe04a187d31b62d96b1aa70abf3e04710 /drivers/pci
parent9de54606d3d55095e4426a81a79a41d8e5e5b6be (diff)
downloadop-kernel-dev-5b889bf237fca383b5807ad69fde3ad1e2287e42.zip
op-kernel-dev-5b889bf237fca383b5807ad69fde3ad1e2287e42.tar.gz
PCI: Fix build if quirks are not enabled
After commit b9c3b266411d27f1a6466c19d146d08db576bfea ("PCI: support device-specific reset methods") the kernel build is broken if CONFIG_PCI_QUIRKS is unset. Fix this by moving pci_dev_specific_reset() to drivers/pci/quirks.c and providing an empty replacement for !CONFIG_PCI_QUIRKS builds. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c15
-rw-r--r--drivers/pci/pci.h2
-rw-r--r--drivers/pci/quirks.c19
3 files changed, 19 insertions, 17 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 864e703..0906599 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2284,21 +2284,6 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe)
return 0;
}
-static int pci_dev_specific_reset(struct pci_dev *dev, int probe)
-{
- struct pci_dev_reset_methods *i;
-
- for (i = pci_dev_reset_methods; i->reset; i++) {
- if ((i->vendor == dev->vendor ||
- i->vendor == (u16)PCI_ANY_ID) &&
- (i->device == dev->device ||
- i->device == (u16)PCI_ANY_ID))
- return i->reset(dev, probe);
- }
-
- return -ENOTTY;
-}
-
static int pci_dev_reset(struct pci_dev *dev, int probe)
{
int rc;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 709eaa4..fbd0e3a 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -319,6 +319,6 @@ struct pci_dev_reset_methods {
int (*reset)(struct pci_dev *dev, int probe);
};
-extern struct pci_dev_reset_methods pci_dev_reset_methods[];
+extern int pci_dev_specific_reset(struct pci_dev *dev, int probe);
#endif /* DRIVERS_PCI_H */
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 8726698..5c449fc 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2684,14 +2684,31 @@ static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe)
#define PCI_DEVICE_ID_INTEL_82599_SFP_VF 0x10ed
-struct pci_dev_reset_methods pci_dev_reset_methods[] = {
+static const struct pci_dev_reset_methods pci_dev_reset_methods[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
reset_intel_82599_sfp_virtfn },
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
reset_intel_generic_dev },
{ 0 }
};
+
+int pci_dev_specific_reset(struct pci_dev *dev, int probe)
+{
+ struct pci_dev_reset_methods *i;
+
+ for (i = pci_dev_reset_methods; i->reset; i++) {
+ if ((i->vendor == dev->vendor ||
+ i->vendor == (u16)PCI_ANY_ID) &&
+ (i->device == dev->device ||
+ i->device == (u16)PCI_ANY_ID))
+ return i->reset(dev, probe);
+ }
+
+ return -ENOTTY;
+}
+
#else
void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {}
+int pci_dev_specific_reset(struct pci_dev *dev, int probe) { return -ENOTTY; }
#endif
EXPORT_SYMBOL(pci_fixup_device);
OpenPOWER on IntegriCloud