summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-orion5x/io.h
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-05-09 20:12:06 +1000
committerPaul Mackerras <paulus@samba.org>2008-05-09 20:12:06 +1000
commit2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92 (patch)
treeb2306840f227972a7c9d4a2b75e516fe81358ce8 /include/asm-arm/arch-orion5x/io.h
parent02539d71fa98d5737bb668b02286c76241e4bac9 (diff)
parent78be76476a34a77f0ea9db2f78ba46a2b0fd5ab5 (diff)
downloadtalos-op-linux-2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92.tar.gz
talos-op-linux-2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92.zip
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx into merge
Diffstat (limited to 'include/asm-arm/arch-orion5x/io.h')
-rw-r--r--include/asm-arm/arch-orion5x/io.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/asm-arm/arch-orion5x/io.h b/include/asm-arm/arch-orion5x/io.h
index 5148ab7ad1f8..50f8c8802206 100644
--- a/include/asm-arm/arch-orion5x/io.h
+++ b/include/asm-arm/arch-orion5x/io.h
@@ -20,11 +20,10 @@ static inline void __iomem *
__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
{
void __iomem *retval;
-
- if (mtype == MT_DEVICE && size && paddr >= ORION5X_REGS_PHYS_BASE &&
- paddr + size <= ORION5X_REGS_PHYS_BASE + ORION5X_REGS_SIZE) {
- retval = (void __iomem *)ORION5X_REGS_VIRT_BASE +
- (paddr - ORION5X_REGS_PHYS_BASE);
+ unsigned long offs = paddr - ORION5X_REGS_PHYS_BASE;
+ if (mtype == MT_DEVICE && size && offs < ORION5X_REGS_SIZE &&
+ size <= ORION5X_REGS_SIZE && offs + size <= ORION5X_REGS_SIZE) {
+ retval = (void __iomem *)ORION5X_REGS_VIRT_BASE + offs;
} else {
retval = __arm_ioremap(paddr, size, mtype);
}
OpenPOWER on IntegriCloud