]> err.no Git - linux-2.6/blobdiff - arch/arm/kernel/ecard.c
[ARM] 4659/1: remove possibilities for spurious false negative with __kuser_cmpxchg
[linux-2.6] / arch / arm / kernel / ecard.c
index 65f1398723a4e86a54b522002438ab6dc8a5a775..f56d48c451ea8dc4438a92e0539de21a7b3fc100 100644 (file)
 #include <linux/init.h>
 #include <linux/mutex.h>
 #include <linux/kthread.h>
+#include <linux/io.h>
 
 #include <asm/dma.h>
 #include <asm/ecard.h>
 #include <asm/hardware.h>
-#include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/mmu_context.h>
 #include <asm/mach/irq.h>
@@ -966,6 +966,23 @@ void ecard_setirq(struct expansion_card *ec, const struct expansion_card_ops *op
 }
 EXPORT_SYMBOL(ecard_setirq);
 
+void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
+                          unsigned long offset, unsigned long maxsize)
+{
+       unsigned long start = ecard_resource_start(ec, res);
+       unsigned long end = ecard_resource_end(ec, res);
+
+       if (offset > (end - start))
+               return NULL;
+
+       start += offset;
+       if (maxsize && end - start > maxsize)
+               end = start + maxsize;
+       
+       return devm_ioremap(&ec->dev, start, end - start);
+}
+EXPORT_SYMBOL(ecardm_iomap);
+
 /*
  * Probe for an expansion card.
  *