diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-01-02 16:57:24 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-02-22 19:15:21 -0500 |
commit | 93177a748ba0d4f3d3e51c8e6c785773bf6a70df (patch) | |
tree | 1207e03e87d1b68a54ff159c9a8a2f279ea0b6a1 /drivers/pci/pci.h | |
parent | 3804259475314a50e4d7a8a974a22fddb6ac7dd7 (diff) |
PCI: Clean up build for CONFIG_PCI_QUIRKS unset
Currently, drivers/pci/quirks.c is built unconditionally, but if
CONFIG_PCI_QUIRKS is unset, the only things actually built in this
file are definitions of global variables and empty functions (due to
the #ifdef CONFIG_PCI_QUIRKS embracing all of the code inside the
file). This is not particularly nice and if someone overlooks
the #ifdef CONFIG_PCI_QUIRKS, build errors are introduced.
To clean that up, move the definitions of the global variables in
quirks.c that are always built to pci.c, move the definitions of
the empty functions (compiled when CONFIG_PCI_QUIRKS is unset) to
headers (additionally make these functions static inline) and modify
drivers/pci/Makefile so that quirks.c is only built if
CONFIG_PCI_QUIRKS is set.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index fbd0e3adbca3..5d169bc3ccd1 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -319,6 +319,13 @@ struct pci_dev_reset_methods { | |||
319 | int (*reset)(struct pci_dev *dev, int probe); | 319 | int (*reset)(struct pci_dev *dev, int probe); |
320 | }; | 320 | }; |
321 | 321 | ||
322 | #ifdef CONFIG_PCI_QUIRKS | ||
322 | extern int pci_dev_specific_reset(struct pci_dev *dev, int probe); | 323 | extern int pci_dev_specific_reset(struct pci_dev *dev, int probe); |
324 | #else | ||
325 | static inline int pci_dev_specific_reset(struct pci_dev *dev, int probe) | ||
326 | { | ||
327 | return -ENOTTY; | ||
328 | } | ||
329 | #endif | ||
323 | 330 | ||
324 | #endif /* DRIVERS_PCI_H */ | 331 | #endif /* DRIVERS_PCI_H */ |