Skip to content

Commit 6e1ffbb

Browse files
Jean-Philippe Bruckerwildea01
authored andcommitted
PCI: Move ATS declarations outside of CONFIG_PCI
At the moment, the ATS functions are only defined when CONFIG_PCI is enabled. Since we're about to use them in the Arm SMMUv3 driver, which could be built with CONFIG_PCI disabled, and they are already guarded by CONFIG_PCI_ATS which depends on CONFIG_PCI, move the definitions outside of CONFIG_PCI. Acked-by: Bjorn Helgaas <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 954a03b commit 6e1ffbb

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

include/linux/pci.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,21 +1521,6 @@ static inline void pcie_ecrc_get_policy(char *str) { }
15211521

15221522
bool pci_ats_disabled(void);
15231523

1524-
#ifdef CONFIG_PCI_ATS
1525-
/* Address Translation Service */
1526-
void pci_ats_init(struct pci_dev *dev);
1527-
int pci_enable_ats(struct pci_dev *dev, int ps);
1528-
void pci_disable_ats(struct pci_dev *dev);
1529-
int pci_ats_queue_depth(struct pci_dev *dev);
1530-
int pci_ats_page_aligned(struct pci_dev *dev);
1531-
#else
1532-
static inline void pci_ats_init(struct pci_dev *d) { }
1533-
static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
1534-
static inline void pci_disable_ats(struct pci_dev *d) { }
1535-
static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
1536-
static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; }
1537-
#endif
1538-
15391524
#ifdef CONFIG_PCIE_PTM
15401525
int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
15411526
#else
@@ -1730,6 +1715,21 @@ static inline const struct pci_device_id *pci_match_id(const struct pci_device_i
17301715
{ return NULL; }
17311716
#endif /* CONFIG_PCI */
17321717

1718+
#ifdef CONFIG_PCI_ATS
1719+
/* Address Translation Service */
1720+
void pci_ats_init(struct pci_dev *dev);
1721+
int pci_enable_ats(struct pci_dev *dev, int ps);
1722+
void pci_disable_ats(struct pci_dev *dev);
1723+
int pci_ats_queue_depth(struct pci_dev *dev);
1724+
int pci_ats_page_aligned(struct pci_dev *dev);
1725+
#else
1726+
static inline void pci_ats_init(struct pci_dev *d) { }
1727+
static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
1728+
static inline void pci_disable_ats(struct pci_dev *d) { }
1729+
static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
1730+
static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; }
1731+
#endif
1732+
17331733
/* Include architecture-dependent settings and functions */
17341734

17351735
#include <asm/pci.h>

0 commit comments

Comments
 (0)