diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-12-31 13:06:35 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-31 15:00:45 -0500 |
commit | 5b889bf237fca383b5807ad69fde3ad1e2287e42 (patch) | |
tree | 91c1df6fe04a187d31b62d96b1aa70abf3e04710 /drivers/pci/quirks.c | |
parent | 9de54606d3d55095e4426a81a79a41d8e5e5b6be (diff) |
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/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 8726698866b1..5c449fc4db19 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) | |||
2684 | 2684 | ||
2685 | #define PCI_DEVICE_ID_INTEL_82599_SFP_VF 0x10ed | 2685 | #define PCI_DEVICE_ID_INTEL_82599_SFP_VF 0x10ed |
2686 | 2686 | ||
2687 | struct pci_dev_reset_methods pci_dev_reset_methods[] = { | 2687 | static const struct pci_dev_reset_methods pci_dev_reset_methods[] = { |
2688 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF, | 2688 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF, |
2689 | reset_intel_82599_sfp_virtfn }, | 2689 | reset_intel_82599_sfp_virtfn }, |
2690 | { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, | 2690 | { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, |
2691 | reset_intel_generic_dev }, | 2691 | reset_intel_generic_dev }, |
2692 | { 0 } | 2692 | { 0 } |
2693 | }; | 2693 | }; |
2694 | |||
2695 | int pci_dev_specific_reset(struct pci_dev *dev, int probe) | ||
2696 | { | ||
2697 | struct pci_dev_reset_methods *i; | ||
2698 | |||
2699 | for (i = pci_dev_reset_methods; i->reset; i++) { | ||
2700 | if ((i->vendor == dev->vendor || | ||
2701 | i->vendor == (u16)PCI_ANY_ID) && | ||
2702 | (i->device == dev->device || | ||
2703 | i->device == (u16)PCI_ANY_ID)) | ||
2704 | return i->reset(dev, probe); | ||
2705 | } | ||
2706 | |||
2707 | return -ENOTTY; | ||
2708 | } | ||
2709 | |||
2694 | #else | 2710 | #else |
2695 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {} | 2711 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) {} |
2712 | int pci_dev_specific_reset(struct pci_dev *dev, int probe) { return -ENOTTY; } | ||
2696 | #endif | 2713 | #endif |
2697 | EXPORT_SYMBOL(pci_fixup_device); | 2714 | EXPORT_SYMBOL(pci_fixup_device); |