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/frv | |
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/frv')
-rw-r--r-- | arch/frv/Kconfig | 1 | ||||
-rw-r--r-- | arch/frv/include/asm/io.h | 2 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/Makefile | 2 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-iomap.c | 29 |
4 files changed, 3 insertions, 31 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index c5e69abb4889..bbbf7927f238 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -317,6 +317,7 @@ config PCI | |||
317 | bool "Use PCI" | 317 | bool "Use PCI" |
318 | depends on MB93090_MB00 | 318 | depends on MB93090_MB00 |
319 | default y | 319 | default y |
320 | select GENERIC_PCI_IOMAP | ||
320 | help | 321 | help |
321 | Some FR-V systems (such as the MB93090-MB00 VDK) have PCI | 322 | Some FR-V systems (such as the MB93090-MB00 VDK) have PCI |
322 | onboard. If you have one of these boards and you wish to use the PCI | 323 | onboard. If you have one of these boards and you wish to use the PCI |
diff --git a/arch/frv/include/asm/io.h b/arch/frv/include/asm/io.h index ca7475e73b5e..8cb50a2fbcb2 100644 --- a/arch/frv/include/asm/io.h +++ b/arch/frv/include/asm/io.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/virtconvert.h> | 21 | #include <asm/virtconvert.h> |
22 | #include <asm/string.h> | 22 | #include <asm/string.h> |
23 | #include <asm/mb-regs.h> | 23 | #include <asm/mb-regs.h> |
24 | #include <asm-generic/pci_iomap.h> | ||
24 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
25 | 26 | ||
26 | /* | 27 | /* |
@@ -370,7 +371,6 @@ static inline void iowrite32_rep(void __iomem *p, const void *src, unsigned long | |||
370 | 371 | ||
371 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | 372 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ |
372 | struct pci_dev; | 373 | struct pci_dev; |
373 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
374 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) | 374 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) |
375 | { | 375 | { |
376 | } | 376 | } |
diff --git a/arch/frv/mb93090-mb00/Makefile b/arch/frv/mb93090-mb00/Makefile index b73b542f8f48..21f1df1b378a 100644 --- a/arch/frv/mb93090-mb00/Makefile +++ b/arch/frv/mb93090-mb00/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | ifeq "$(CONFIG_PCI)" "y" | 5 | ifeq "$(CONFIG_PCI)" "y" |
6 | obj-y := pci-frv.o pci-irq.o pci-vdk.o pci-iomap.o | 6 | obj-y := pci-frv.o pci-irq.o pci-vdk.o |
7 | 7 | ||
8 | ifeq "$(CONFIG_MMU)" "y" | 8 | ifeq "$(CONFIG_MMU)" "y" |
9 | obj-y += pci-dma.o | 9 | obj-y += pci-dma.o |
diff --git a/arch/frv/mb93090-mb00/pci-iomap.c b/arch/frv/mb93090-mb00/pci-iomap.c deleted file mode 100644 index 35f6df28351e..000000000000 --- a/arch/frv/mb93090-mb00/pci-iomap.c +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* pci-iomap.c: description | ||
2 | * | ||
3 | * Copyright (C) 2006 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 License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <linux/pci.h> | ||
12 | #include <linux/module.h> | ||
13 | |||
14 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
15 | { | ||
16 | resource_size_t start = pci_resource_start(dev, bar); | ||
17 | resource_size_t len = pci_resource_len(dev, bar); | ||
18 | unsigned long flags = pci_resource_flags(dev, bar); | ||
19 | |||
20 | if (!len || !start) | ||
21 | return NULL; | ||
22 | |||
23 | if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM)) | ||
24 | return (void __iomem *) start; | ||
25 | |||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | EXPORT_SYMBOL(pci_iomap); | ||