Commit 677c2aec authored by Ben Hutchings's avatar Ben Hutchings Committed by David Woodhouse

mtd: Use get_mtd_device_nm() to find named device in get_sb_mtd()

This removes the need to know the number of MTD devices.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent f1332ba2
...@@ -150,19 +150,13 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags, ...@@ -150,19 +150,13 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags,
DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n", DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n",
dev_name + 4); dev_name + 4);
for (mtdnr = 0; mtdnr < MAX_MTD_DEVICES; mtdnr++) { mtd = get_mtd_device_nm(dev_name + 4);
mtd = get_mtd_device(NULL, mtdnr); if (!IS_ERR(mtd))
if (!IS_ERR(mtd)) {
if (!strcmp(mtd->name, dev_name + 4))
return get_sb_mtd_aux( return get_sb_mtd_aux(
fs_type, flags, fs_type, flags,
dev_name, data, mtd, dev_name, data, mtd,
fill_super, mnt); fill_super, mnt);
put_mtd_device(mtd);
}
}
printk(KERN_NOTICE "MTD:" printk(KERN_NOTICE "MTD:"
" MTD device with name \"%s\" not found.\n", " MTD device with name \"%s\" not found.\n",
dev_name + 4); dev_name + 4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment