[RFC/PATCH 6/12] powerpc: Remove #ifdef ISERIES from insw_ns/insl_ns in io.h
Michael Ellerman
michael at ellerman.id.au
Tue Jan 17 14:22:29 EST 2006
Make insw_ns/insl_ns compilable on a combined kernel.
include/asm-powerpc/io.h | 36 +++++++++++++++++++++++-------------
1 files changed, 23 insertions(+), 13 deletions(-)
Index: linux/include/asm-powerpc/io.h
===================================================================
--- linux.orig/include/asm-powerpc/io.h
+++ linux/include/asm-powerpc/io.h
@@ -44,17 +44,7 @@ extern unsigned long io_page_mask;
#define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \
& io_page_mask)
-#ifdef CONFIG_PPC_ISERIES
-
-/*
- * The *_ns versions below don't do byte-swapping.
- * Neither do the standard versions now, these are just here
- * for older code.
- */
-#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
-#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl))
-#else
-
+#ifndef CONFIG_PPC_ISERIES
/*
* The insw/outsw/insl/outsl macros don't do byte-swapping.
* They are only used in practice for transferring buffers which
@@ -63,8 +53,6 @@ extern unsigned long io_page_mask;
#define insb(port, buf, ns) eeh_insb((port), (buf), (ns))
#define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
#define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
-#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns))
-#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl))
#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns))
#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns))
@@ -522,6 +510,28 @@ static inline void outl(u32 val, unsigne
return eeh_outl(val, addr);
}
+/*
+ * The *_ns versions below don't do byte-swapping.
+ * Neither do the standard versions now, these are just here
+ * for older code.
+ */
+
+static inline void insw_ns(unsigned long port, void *buf, int ns)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ _insw_ns((u16 __iomem *)(port + pci_io_base), buf, ns);
+ else
+ eeh_insw_ns(port, buf, ns);
+}
+
+static inline void insl_ns(unsigned long port, void *buf, int nl)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ _insl_ns((u32 __iomem *)(port + pci_io_base), buf, nl);
+ else
+ eeh_insl_ns(port, buf, nl);
+}
+
/**
* check_signature - find BIOS signatures
* @io_addr: mmio address to check
More information about the Linuxppc64-dev
mailing list