Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

frv: switch to GENERIC_PCI_IOMAP

frv uses a version of pci_iomap that simply
casts and returns back the start address.
Looking closely, both ioremap and ioport_map seem to
do this on this platform, so the generic pci_iomap
will DTRT automatically.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

+3 -31
+1
arch/frv/Kconfig
··· 317 317 bool "Use PCI" 318 318 depends on MB93090_MB00 319 319 default y 320 + select GENERIC_PCI_IOMAP 320 321 help 321 322 Some FR-V systems (such as the MB93090-MB00 VDK) have PCI 322 323 onboard. If you have one of these boards and you wish to use the PCI
+1 -1
arch/frv/include/asm/io.h
··· 21 21 #include <asm/virtconvert.h> 22 22 #include <asm/string.h> 23 23 #include <asm/mb-regs.h> 24 + #include <asm-generic/pci_iomap.h> 24 25 #include <linux/delay.h> 25 26 26 27 /* ··· 371 370 372 371 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 373 372 struct pci_dev; 374 - extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); 375 373 static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) 376 374 { 377 375 }
+1 -1
arch/frv/mb93090-mb00/Makefile
··· 3 3 # 4 4 5 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 8 ifeq "$(CONFIG_MMU)" "y" 9 9 obj-y += pci-dma.o
-29
arch/frv/mb93090-mb00/pci-iomap.c
··· 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);