]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/mtd/mtdsuper.c
nand/denali: use cpu_relax() while waiting for hardware interrupt
[mv-sheeva.git] / drivers / mtd / mtdsuper.c
index 7c003191fca444aa191119f485fd609727aa62d8..38e2ab07e7a3fc771f40d7a4448b52906d88c0d6 100644 (file)
@@ -1,6 +1,8 @@
 /* MTD-based superblock management
  *
  * Copyright © 2001-2007 Red Hat, Inc. All Rights Reserved.
+ * Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org>
+ *
  * Written by:  David Howells <dhowells@redhat.com>
  *              David Woodhouse <dwmw2@infradead.org>
  *
@@ -152,18 +154,12 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
                        DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n",
                              dev_name + 4);
 
-                       for (mtdnr = 0; mtdnr < MAX_MTD_DEVICES; mtdnr++) {
-                               mtd = get_mtd_device(NULL, mtdnr);
-                               if (!IS_ERR(mtd)) {
-                                       if (!strcmp(mtd->name, dev_name + 4))
-                                               return get_sb_mtd_aux(
-                                                       fs_type, flags,
-                                                       dev_name, data, mtd,
-                                                       fill_super, mnt);
-
-                                       put_mtd_device(mtd);
-                               }
-                       }
+                       mtd = get_mtd_device_nm(dev_name + 4);
+                       if (!IS_ERR(mtd))
+                               return get_sb_mtd_aux(
+                                       fs_type, flags,
+                                       dev_name, data, mtd,
+                                       fill_super, mnt);
 
                        printk(KERN_NOTICE "MTD:"
                               " MTD device with name \"%s\" not found.\n",