diff options
author | David Woodhouse <dwmw@amazon.co.uk> | 2017-04-12 08:25:55 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-04-18 14:02:11 -0400 |
commit | 11df19546fe4a6135cdae62e96a1e25b3fabf6ea (patch) | |
tree | 12f07a5a618c1fd9dcdddc918b97a00a45192489 | |
parent | ae749c7ab475de2c9c427058db19921c91846e89 (diff) |
PCI: Move multiple declarations of pci_mmap_page_range() to <linux/pci.h>
We can declare it <linux/pci.h> even on platforms where it isn't going to
be defined. There's no need to have it littered through the various
<asm/pci.h> files.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/arm/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/cris/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/ia64/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/microblaze/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/mips/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/mn10300/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/parisc/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/powerpc/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/sh/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/sparc/include/asm/pci_64.h | 4 | ||||
-rw-r--r-- | arch/unicore32/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/pci.h | 4 | ||||
-rw-r--r-- | arch/xtensa/include/asm/pci.h | 4 | ||||
-rw-r--r-- | include/linux/pci.h | 7 |
14 files changed, 8 insertions, 38 deletions
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 057d381f4e57..51118a0cabbc 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h | |||
@@ -29,8 +29,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
29 | #define PCI_DMA_BUS_IS_PHYS (1) | 29 | #define PCI_DMA_BUS_IS_PHYS (1) |
30 | 30 | ||
31 | #define HAVE_PCI_MMAP | 31 | #define HAVE_PCI_MMAP |
32 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
33 | enum pci_mmap_state mmap_state, int write_combine); | ||
34 | 32 | ||
35 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | 33 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) |
36 | { | 34 | { |
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h index b1b289df04c7..65198cb46c85 100644 --- a/arch/cris/include/asm/pci.h +++ b/arch/cris/include/asm/pci.h | |||
@@ -42,9 +42,6 @@ struct pci_dev; | |||
42 | #define PCI_DMA_BUS_IS_PHYS (1) | 42 | #define PCI_DMA_BUS_IS_PHYS (1) |
43 | 43 | ||
44 | #define HAVE_PCI_MMAP | 44 | #define HAVE_PCI_MMAP |
45 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
46 | enum pci_mmap_state mmap_state, int write_combine); | ||
47 | |||
48 | 45 | ||
49 | #endif /* __KERNEL__ */ | 46 | #endif /* __KERNEL__ */ |
50 | 47 | ||
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 6283758474ad..fc60b3d139f4 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h | |||
@@ -53,8 +53,6 @@ extern unsigned long ia64_max_iommu_merge_mask; | |||
53 | #define HAVE_PCI_MMAP | 53 | #define HAVE_PCI_MMAP |
54 | #define arch_can_pci_mmap_wc() 1 | 54 | #define arch_can_pci_mmap_wc() 1 |
55 | 55 | ||
56 | extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, | ||
57 | enum pci_mmap_state mmap_state, int write_combine); | ||
58 | #define HAVE_PCI_LEGACY | 56 | #define HAVE_PCI_LEGACY |
59 | extern int pci_mmap_legacy_page_range(struct pci_bus *bus, | 57 | extern int pci_mmap_legacy_page_range(struct pci_bus *bus, |
60 | struct vm_area_struct *vma, | 58 | struct vm_area_struct *vma, |
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h index 2a120bb70e54..ab381d283fb9 100644 --- a/arch/microblaze/include/asm/pci.h +++ b/arch/microblaze/include/asm/pci.h | |||
@@ -46,9 +46,6 @@ extern int pci_domain_nr(struct pci_bus *bus); | |||
46 | extern int pci_proc_domain(struct pci_bus *bus); | 46 | extern int pci_proc_domain(struct pci_bus *bus); |
47 | 47 | ||
48 | struct vm_area_struct; | 48 | struct vm_area_struct; |
49 | /* Map a range of PCI memory or I/O space for a device into user space */ | ||
50 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | ||
51 | enum pci_mmap_state mmap_state, int write_combine); | ||
52 | 49 | ||
53 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ | 50 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ |
54 | #define HAVE_PCI_MMAP 1 | 51 | #define HAVE_PCI_MMAP 1 |
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 30d1129d8624..3141e2a8113a 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
@@ -111,9 +111,6 @@ extern void pcibios_set_master(struct pci_dev *dev); | |||
111 | 111 | ||
112 | #define HAVE_PCI_MMAP | 112 | #define HAVE_PCI_MMAP |
113 | 113 | ||
114 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
115 | enum pci_mmap_state mmap_state, int write_combine); | ||
116 | |||
117 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER | 114 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER |
118 | 115 | ||
119 | /* | 116 | /* |
diff --git a/arch/mn10300/include/asm/pci.h b/arch/mn10300/include/asm/pci.h index 51159fff025a..082b6de90936 100644 --- a/arch/mn10300/include/asm/pci.h +++ b/arch/mn10300/include/asm/pci.h | |||
@@ -74,9 +74,6 @@ static inline int pci_controller_num(struct pci_dev *dev) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | #define HAVE_PCI_MMAP | 76 | #define HAVE_PCI_MMAP |
77 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
78 | enum pci_mmap_state mmap_state, | ||
79 | int write_combine); | ||
80 | 77 | ||
81 | #endif /* __KERNEL__ */ | 78 | #endif /* __KERNEL__ */ |
82 | 79 | ||
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index defebd956585..bb9ea9003e08 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h | |||
@@ -201,7 +201,4 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
201 | 201 | ||
202 | #define HAVE_PCI_MMAP | 202 | #define HAVE_PCI_MMAP |
203 | 203 | ||
204 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
205 | enum pci_mmap_state mmap_state, int write_combine); | ||
206 | |||
207 | #endif /* __ASM_PARISC_PCI_H */ | 204 | #endif /* __ASM_PARISC_PCI_H */ |
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index b5b68c6a10b1..55887d171205 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h | |||
@@ -77,9 +77,6 @@ extern int pci_domain_nr(struct pci_bus *bus); | |||
77 | extern int pci_proc_domain(struct pci_bus *bus); | 77 | extern int pci_proc_domain(struct pci_bus *bus); |
78 | 78 | ||
79 | struct vm_area_struct; | 79 | struct vm_area_struct; |
80 | /* Map a range of PCI memory or I/O space for a device into user space */ | ||
81 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | ||
82 | enum pci_mmap_state mmap_state, int write_combine); | ||
83 | 80 | ||
84 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() and it does WC */ | 81 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() and it does WC */ |
85 | #define HAVE_PCI_MMAP 1 | 82 | #define HAVE_PCI_MMAP 1 |
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h index 644314f2b1ef..46abbc9983c9 100644 --- a/arch/sh/include/asm/pci.h +++ b/arch/sh/include/asm/pci.h | |||
@@ -66,8 +66,7 @@ extern unsigned long PCIBIOS_MIN_IO, PCIBIOS_MIN_MEM; | |||
66 | struct pci_dev; | 66 | struct pci_dev; |
67 | 67 | ||
68 | #define HAVE_PCI_MMAP | 68 | #define HAVE_PCI_MMAP |
69 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | 69 | |
70 | enum pci_mmap_state mmap_state, int write_combine); | ||
71 | extern void pcibios_set_master(struct pci_dev *dev); | 70 | extern void pcibios_set_master(struct pci_dev *dev); |
72 | 71 | ||
73 | /* Dynamic DMA mapping stuff. | 72 | /* Dynamic DMA mapping stuff. |
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h index 2303635158f5..516fda70a1bb 100644 --- a/arch/sparc/include/asm/pci_64.h +++ b/arch/sparc/include/asm/pci_64.h | |||
@@ -45,10 +45,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
45 | #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA | 45 | #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA |
46 | #define get_pci_unmapped_area get_fb_unmapped_area | 46 | #define get_pci_unmapped_area get_fb_unmapped_area |
47 | 47 | ||
48 | int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
49 | enum pci_mmap_state mmap_state, | ||
50 | int write_combine); | ||
51 | |||
52 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | 48 | static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) |
53 | { | 49 | { |
54 | return PCI_IRQ_NONE; | 50 | return PCI_IRQ_NONE; |
diff --git a/arch/unicore32/include/asm/pci.h b/arch/unicore32/include/asm/pci.h index 37e55d018de5..a51290862acd 100644 --- a/arch/unicore32/include/asm/pci.h +++ b/arch/unicore32/include/asm/pci.h | |||
@@ -17,8 +17,6 @@ | |||
17 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ | 17 | #include <mach/hardware.h> /* for PCIBIOS_MIN_* */ |
18 | 18 | ||
19 | #define HAVE_PCI_MMAP | 19 | #define HAVE_PCI_MMAP |
20 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
21 | enum pci_mmap_state mmap_state, int write_combine); | ||
22 | 20 | ||
23 | #endif /* __KERNEL__ */ | 21 | #endif /* __KERNEL__ */ |
24 | #endif | 22 | #endif |
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index f6e22c271efa..734cc9411b3a 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h | |||
@@ -104,10 +104,6 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); | |||
104 | 104 | ||
105 | #define HAVE_PCI_MMAP | 105 | #define HAVE_PCI_MMAP |
106 | #define arch_can_pci_mmap_wc() pat_enabled() | 106 | #define arch_can_pci_mmap_wc() pat_enabled() |
107 | extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | ||
108 | enum pci_mmap_state mmap_state, | ||
109 | int write_combine); | ||
110 | |||
111 | 107 | ||
112 | #ifdef CONFIG_PCI | 108 | #ifdef CONFIG_PCI |
113 | extern void early_quirks(void); | 109 | extern void early_quirks(void); |
diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h index 5d6bd932ba4e..bb5510b28754 100644 --- a/arch/xtensa/include/asm/pci.h +++ b/arch/xtensa/include/asm/pci.h | |||
@@ -46,10 +46,6 @@ struct pci_dev; | |||
46 | 46 | ||
47 | #define PCI_DMA_BUS_IS_PHYS (1) | 47 | #define PCI_DMA_BUS_IS_PHYS (1) |
48 | 48 | ||
49 | /* Map a range of PCI memory or I/O space for a device into user space */ | ||
50 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | ||
51 | enum pci_mmap_state mmap_state, int write_combine); | ||
52 | |||
53 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ | 49 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ |
54 | #define HAVE_PCI_MMAP 1 | 50 | #define HAVE_PCI_MMAP 1 |
55 | 51 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index e614fb42d8bb..e7bb4b62cc97 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1626,6 +1626,13 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } | |||
1626 | 1626 | ||
1627 | #include <asm/pci.h> | 1627 | #include <asm/pci.h> |
1628 | 1628 | ||
1629 | /* Map a range of PCI memory or I/O space for a device into user space. | ||
1630 | * Architectures provide this function if they set HAVE_PCI_MMAP, and | ||
1631 | * it accepts the 'write_combine' argument when arch_can_pci_mmap_wc() | ||
1632 | * evaluates to nonzero. */ | ||
1633 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | ||
1634 | enum pci_mmap_state mmap_state, int write_combine); | ||
1635 | |||
1629 | #ifndef arch_can_pci_mmap_wc | 1636 | #ifndef arch_can_pci_mmap_wc |
1630 | #define arch_can_pci_mmap_wc() 0 | 1637 | #define arch_can_pci_mmap_wc() 0 |
1631 | #endif | 1638 | #endif |