diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 21:04:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 21:04:27 -0500 |
commit | e343a895a9f342f239c5e3c5ffc6c0b1707e6244 (patch) | |
tree | 46c81c6ae375b1f14e209b13c8ac020842807ece /arch/mn10300 | |
parent | 06792c4dde2ad143928cc95c1ba218c6269c494b (diff) | |
parent | 193a667fba76b3df482cbf865228e26ee246e889 (diff) |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
lib: use generic pci_iomap on all architectures
Many architectures don't want to pull in iomap.c,
so they ended up duplicating pci_iomap from that file.
That function isn't trivial, and we are going to modify it
https://lkml.org/lkml/2011/11/14/183
so the duplication hurts.
This reduces the scope of the problem significantly,
by moving pci_iomap to a separate file and
referencing that from all architectures.
* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
alpha: drop pci_iomap/pci_iounmap from pci-noop.c
mn10300: switch to GENERIC_PCI_IOMAP
mn10300: add missing __iomap markers
frv: switch to GENERIC_PCI_IOMAP
tile: switch to GENERIC_PCI_IOMAP
tile: don't panic on iomap
sparc: switch to GENERIC_PCI_IOMAP
sh: switch to GENERIC_PCI_IOMAP
powerpc: switch to GENERIC_PCI_IOMAP
parisc: switch to GENERIC_PCI_IOMAP
mips: switch to GENERIC_PCI_IOMAP
microblaze: switch to GENERIC_PCI_IOMAP
arm: switch to GENERIC_PCI_IOMAP
alpha: switch to GENERIC_PCI_IOMAP
lib: add GENERIC_PCI_IOMAP
lib: move GENERIC_IOMAP to lib/Kconfig
Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/Kconfig | 1 | ||||
-rw-r--r-- | arch/mn10300/include/asm/io.h | 17 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/Makefile | 2 | ||||
-rw-r--r-- | arch/mn10300/unit-asb2305/pci-iomap.c | 31 |
4 files changed, 10 insertions, 41 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 438db84a1f7c..8f1c40d5817e 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -252,6 +252,7 @@ config PCI | |||
252 | bool "Use PCI" | 252 | bool "Use PCI" |
253 | depends on MN10300_UNIT_ASB2305 | 253 | depends on MN10300_UNIT_ASB2305 |
254 | default y | 254 | default y |
255 | select GENERIC_PCI_IOMAP | ||
255 | help | 256 | help |
256 | Some systems (such as the ASB2305) have PCI onboard. If you have one | 257 | Some systems (such as the ASB2305) have PCI onboard. If you have one |
257 | of these boards and you wish to use the PCI facilities, say Y here. | 258 | of these boards and you wish to use the PCI facilities, say Y here. |
diff --git a/arch/mn10300/include/asm/io.h b/arch/mn10300/include/asm/io.h index 787255da744e..139df8c53de8 100644 --- a/arch/mn10300/include/asm/io.h +++ b/arch/mn10300/include/asm/io.h | |||
@@ -229,7 +229,6 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
229 | 229 | ||
230 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 230 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
231 | struct pci_dev; | 231 | struct pci_dev; |
232 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
233 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) | 232 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) |
234 | { | 233 | { |
235 | } | 234 | } |
@@ -251,15 +250,15 @@ static inline void *phys_to_virt(unsigned long address) | |||
251 | /* | 250 | /* |
252 | * Change "struct page" to physical address. | 251 | * Change "struct page" to physical address. |
253 | */ | 252 | */ |
254 | static inline void *__ioremap(unsigned long offset, unsigned long size, | 253 | static inline void __iomem *__ioremap(unsigned long offset, unsigned long size, |
255 | unsigned long flags) | 254 | unsigned long flags) |
256 | { | 255 | { |
257 | return (void *) offset; | 256 | return (void __iomem *) offset; |
258 | } | 257 | } |
259 | 258 | ||
260 | static inline void *ioremap(unsigned long offset, unsigned long size) | 259 | static inline void __iomem *ioremap(unsigned long offset, unsigned long size) |
261 | { | 260 | { |
262 | return (void *) offset; | 261 | return (void __iomem *) offset; |
263 | } | 262 | } |
264 | 263 | ||
265 | /* | 264 | /* |
@@ -267,14 +266,14 @@ static inline void *ioremap(unsigned long offset, unsigned long size) | |||
267 | * area. it's useful if some control registers are in such an area and write | 266 | * area. it's useful if some control registers are in such an area and write |
268 | * combining or read caching is not desirable: | 267 | * combining or read caching is not desirable: |
269 | */ | 268 | */ |
270 | static inline void *ioremap_nocache(unsigned long offset, unsigned long size) | 269 | static inline void __iomem *ioremap_nocache(unsigned long offset, unsigned long size) |
271 | { | 270 | { |
272 | return (void *) (offset | 0x20000000); | 271 | return (void __iomem *) (offset | 0x20000000); |
273 | } | 272 | } |
274 | 273 | ||
275 | #define ioremap_wc ioremap_nocache | 274 | #define ioremap_wc ioremap_nocache |
276 | 275 | ||
277 | static inline void iounmap(void *addr) | 276 | static inline void iounmap(void __iomem *addr) |
278 | { | 277 | { |
279 | } | 278 | } |
280 | 279 | ||
diff --git a/arch/mn10300/unit-asb2305/Makefile b/arch/mn10300/unit-asb2305/Makefile index 0551022225b3..cbc5abaa939a 100644 --- a/arch/mn10300/unit-asb2305/Makefile +++ b/arch/mn10300/unit-asb2305/Makefile | |||
@@ -5,4 +5,4 @@ | |||
5 | ############################################################################### | 5 | ############################################################################### |
6 | obj-y := unit-init.o leds.o | 6 | obj-y := unit-init.o leds.o |
7 | 7 | ||
8 | obj-$(CONFIG_PCI) += pci.o pci-asb2305.o pci-irq.o pci-iomap.o | 8 | obj-$(CONFIG_PCI) += pci.o pci-asb2305.o pci-irq.o |
diff --git a/arch/mn10300/unit-asb2305/pci-iomap.c b/arch/mn10300/unit-asb2305/pci-iomap.c deleted file mode 100644 index c1a8d8f941fd..000000000000 --- a/arch/mn10300/unit-asb2305/pci-iomap.c +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* ASB2305 PCI I/O mapping handler | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public Licence | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the Licence, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <linux/pci.h> | ||
12 | #include <linux/module.h> | ||
13 | |||
14 | /* | ||
15 | * Create a virtual mapping cookie for a PCI BAR (memory or IO) | ||
16 | */ | ||
17 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
18 | { | ||
19 | resource_size_t start = pci_resource_start(dev, bar); | ||
20 | resource_size_t len = pci_resource_len(dev, bar); | ||
21 | unsigned long flags = pci_resource_flags(dev, bar); | ||
22 | |||
23 | if (!len || !start) | ||
24 | return NULL; | ||
25 | |||
26 | if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM)) | ||
27 | return (void __iomem *) start; | ||
28 | |||
29 | return NULL; | ||
30 | } | ||
31 | EXPORT_SYMBOL(pci_iomap); | ||