]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/sh/kernel/io_trapped.c
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
[mv-sheeva.git] / arch / sh / kernel / io_trapped.c
index 86a665d92201ef67ca91349da2bf46d4717edf45..c22853b059efd118528cbff82a02b399412add8c 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/bitops.h>
 #include <linux/vmalloc.h>
 #include <linux/module.h>
+#include <linux/init.h>
 #include <asm/system.h>
 #include <asm/mmu_context.h>
 #include <asm/uaccess.h>
@@ -32,13 +33,25 @@ EXPORT_SYMBOL_GPL(trapped_mem);
 #endif
 static DEFINE_SPINLOCK(trapped_lock);
 
-int __init register_trapped_io(struct trapped_io *tiop)
+static int trapped_io_disable __read_mostly;
+
+static int __init trapped_io_setup(char *__unused)
+{
+       trapped_io_disable = 1;
+       return 1;
+}
+__setup("noiotrap", trapped_io_setup);
+
+int register_trapped_io(struct trapped_io *tiop)
 {
        struct resource *res;
        unsigned long len = 0, flags = 0;
        struct page *pages[TRAPPED_PAGES_MAX];
        int k, n;
 
+       if (unlikely(trapped_io_disable))
+               return 0;
+
        /* structure must be page aligned */
        if ((unsigned long)tiop & (PAGE_SIZE - 1))
                goto bad;