]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/mtd/mtdsuper.c
mtd: Use get_mtd_device_nm() to find named device in get_sb_mtd()
[net-next-2.6.git] / drivers / mtd / mtdsuper.c
index af8b42e0a55bedfaf3fdae1fc02fa3367e09d011..d2570523d7033c3710cc86efdc94b4e7fcd769ea 100644 (file)
@@ -150,18 +150,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",