aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-05-10 13:40:51 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-05-11 12:19:02 -0400
commit10bdaaa0fad620145cf10e2b573266b2d80b44de (patch)
tree8d3200f5041ab0fdc72e9245ef780310b27a18d8 /arch/arm
parentc7b87f3d5037a35b5c7bb916ffc826be3fcb208d (diff)
[ARM] ecard: add ecardm_iomap() / ecardm_iounmap()
Add devres ecardm_iomap() and ecardm_iounmap() for Acorn expansion cards. Convert all expansion card drivers to use them. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/ecard.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 65f1398723a4..f56d48c451ea 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -41,11 +41,11 @@
41#include <linux/init.h> 41#include <linux/init.h>
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/kthread.h> 43#include <linux/kthread.h>
44#include <linux/io.h>
44 45
45#include <asm/dma.h> 46#include <asm/dma.h>
46#include <asm/ecard.h> 47#include <asm/ecard.h>
47#include <asm/hardware.h> 48#include <asm/hardware.h>
48#include <asm/io.h>
49#include <asm/irq.h> 49#include <asm/irq.h>
50#include <asm/mmu_context.h> 50#include <asm/mmu_context.h>
51#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
@@ -966,6 +966,23 @@ void ecard_setirq(struct expansion_card *ec, const struct expansion_card_ops *op
966} 966}
967EXPORT_SYMBOL(ecard_setirq); 967EXPORT_SYMBOL(ecard_setirq);
968 968
969void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
970 unsigned long offset, unsigned long maxsize)
971{
972 unsigned long start = ecard_resource_start(ec, res);
973 unsigned long end = ecard_resource_end(ec, res);
974
975 if (offset > (end - start))
976 return NULL;
977
978 start += offset;
979 if (maxsize && end - start > maxsize)
980 end = start + maxsize;
981
982 return devm_ioremap(&ec->dev, start, end - start);
983}
984EXPORT_SYMBOL(ecardm_iomap);
985
969/* 986/*
970 * Probe for an expansion card. 987 * Probe for an expansion card.
971 * 988 *