diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-01-29 15:57:18 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-25 06:38:35 -0500 |
commit | 677c2aec8cdd5ae33b5fab266941cf6c6dc4d59f (patch) | |
tree | 76f2c82d7f7593773dd6c454bac487c9a97106db /drivers | |
parent | f1332ba2f23800bb5d52457ac150c568dfb1f3bf (diff) |
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: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/mtdsuper.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c index af8b42e0a55b..d2570523d703 100644 --- a/drivers/mtd/mtdsuper.c +++ b/drivers/mtd/mtdsuper.c | |||
@@ -150,18 +150,12 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags, | |||
150 | DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n", | 150 | DEBUG(1, "MTDSB: mtd:%%s, name \"%s\"\n", |
151 | dev_name + 4); | 151 | dev_name + 4); |
152 | 152 | ||
153 | for (mtdnr = 0; mtdnr < MAX_MTD_DEVICES; mtdnr++) { | 153 | mtd = get_mtd_device_nm(dev_name + 4); |
154 | mtd = get_mtd_device(NULL, mtdnr); | 154 | if (!IS_ERR(mtd)) |
155 | if (!IS_ERR(mtd)) { | 155 | return get_sb_mtd_aux( |
156 | if (!strcmp(mtd->name, dev_name + 4)) | 156 | fs_type, flags, |
157 | return get_sb_mtd_aux( | 157 | dev_name, data, mtd, |
158 | fs_type, flags, | 158 | fill_super, mnt); |
159 | dev_name, data, mtd, | ||
160 | fill_super, mnt); | ||
161 | |||
162 | put_mtd_device(mtd); | ||
163 | } | ||
164 | } | ||
165 | 159 | ||
166 | printk(KERN_NOTICE "MTD:" | 160 | printk(KERN_NOTICE "MTD:" |
167 | " MTD device with name \"%s\" not found.\n", | 161 | " MTD device with name \"%s\" not found.\n", |