From 2ebf5d0d79087005e1042df2cd0f7594782746d8 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 1 Dec 2011 13:12:22 +0200 Subject: mn10300: add missing __iomap markers MN10300's *ioremap*() collection lacks __iomem markers. Fix that. Signed-off-by: Michael S. Tsirkin --- arch/mn10300/include/asm/io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'arch/mn10300') diff --git a/arch/mn10300/include/asm/io.h b/arch/mn10300/include/asm/io.h index 787255da744e..0d6d54f09f17 100644 --- a/arch/mn10300/include/asm/io.h +++ b/arch/mn10300/include/asm/io.h @@ -251,15 +251,15 @@ static inline void *phys_to_virt(unsigned long address) /* * Change "struct page" to physical address. */ -static inline void *__ioremap(unsigned long offset, unsigned long size, - unsigned long flags) +static inline void __iomem *__ioremap(unsigned long offset, unsigned long size, + unsigned long flags) { - return (void *) offset; + return (void __iomem *) offset; } -static inline void *ioremap(unsigned long offset, unsigned long size) +static inline void __iomem *ioremap(unsigned long offset, unsigned long size) { - return (void *) offset; + return (void __iomem *) offset; } /* @@ -267,14 +267,14 @@ static inline void *ioremap(unsigned long offset, unsigned long size) * area. it's useful if some control registers are in such an area and write * combining or read caching is not desirable: */ -static inline void *ioremap_nocache(unsigned long offset, unsigned long size) +static inline void __iomem *ioremap_nocache(unsigned long offset, unsigned long size) { - return (void *) (offset | 0x20000000); + return (void __iomem *) (offset | 0x20000000); } #define ioremap_wc ioremap_nocache -static inline void iounmap(void *addr) +static inline void iounmap(void __iomem *addr) { } -- cgit v1.2.3 From 34f1bdee1910f7efe3c32e1a891dba4fd21cb3b6 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 1 Dec 2011 12:41:36 +0200 Subject: mn10300: switch to GENERIC_PCI_IOMAP The pci_iomap variant that arch/mn10300/unit-asb2305/pci-iomap.c uses differs from the generic one in that it does not use ioremap_nocache for PCI addresses. However, it turns out that PCI addresses are automatically noncached, so switching to ioremap_nocache and to the generic implementation is safe. Signed-off-by: Michael S. Tsirkin --- arch/mn10300/Kconfig | 1 + arch/mn10300/include/asm/io.h | 1 - arch/mn10300/unit-asb2305/Makefile | 2 +- arch/mn10300/unit-asb2305/pci-iomap.c | 31 ------------------------------- 4 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 arch/mn10300/unit-asb2305/pci-iomap.c (limited to 'arch/mn10300') 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 bool "Use PCI" depends on MN10300_UNIT_ASB2305 default y + select GENERIC_PCI_IOMAP help Some systems (such as the ASB2305) have PCI onboard. If you have one 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 0d6d54f09f17..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) /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ struct pci_dev; -extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) { } 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 @@ ############################################################################### obj-y := unit-init.o leds.o -obj-$(CONFIG_PCI) += pci.o pci-asb2305.o pci-irq.o pci-iomap.o +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 @@ -/* ASB2305 PCI I/O mapping handler - * - * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. - * Written by David Howells (dhowells@redhat.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public Licence - * as published by the Free Software Foundation; either version - * 2 of the Licence, or (at your option) any later version. - */ -#include -#include - -/* - * Create a virtual mapping cookie for a PCI BAR (memory or IO) - */ -void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) -{ - resource_size_t start = pci_resource_start(dev, bar); - resource_size_t len = pci_resource_len(dev, bar); - unsigned long flags = pci_resource_flags(dev, bar); - - if (!len || !start) - return NULL; - - if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM)) - return (void __iomem *) start; - - return NULL; -} -EXPORT_SYMBOL(pci_iomap); -- cgit v1.2.3