diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-01-29 15:57:11 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-25 06:37:16 -0500 |
commit | f1332ba2f23800bb5d52457ac150c568dfb1f3bf (patch) | |
tree | 1c5c9e3d2727ea39f0bdc03e47b5f895fa0c1b7b /drivers/mtd/mtd_blkdevs.c | |
parent | 0040476b0efa99ad0d4ffb81d8e882095420d288 (diff) |
mtd: Introduce and use iteration macro for reading the MTD device table
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/mtd/mtd_blkdevs.c')
-rw-r--r-- | drivers/mtd/mtd_blkdevs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index c82e09bbc5fd..85a52b3c7698 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c | |||
@@ -335,7 +335,8 @@ static struct mtd_notifier blktrans_notifier = { | |||
335 | 335 | ||
336 | int register_mtd_blktrans(struct mtd_blktrans_ops *tr) | 336 | int register_mtd_blktrans(struct mtd_blktrans_ops *tr) |
337 | { | 337 | { |
338 | int ret, i; | 338 | struct mtd_info *mtd; |
339 | int ret; | ||
339 | 340 | ||
340 | /* Register the notifier if/when the first device type is | 341 | /* Register the notifier if/when the first device type is |
341 | registered, to prevent the link/init ordering from fucking | 342 | registered, to prevent the link/init ordering from fucking |
@@ -389,10 +390,9 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr) | |||
389 | INIT_LIST_HEAD(&tr->devs); | 390 | INIT_LIST_HEAD(&tr->devs); |
390 | list_add(&tr->list, &blktrans_majors); | 391 | list_add(&tr->list, &blktrans_majors); |
391 | 392 | ||
392 | for (i=0; i<MAX_MTD_DEVICES; i++) { | 393 | mtd_for_each_device(mtd) |
393 | if (mtd_table[i] && mtd_table[i]->type != MTD_ABSENT) | 394 | if (mtd->type != MTD_ABSENT) |
394 | tr->add_mtd(tr, mtd_table[i]); | 395 | tr->add_mtd(tr, mtd); |
395 | } | ||
396 | 396 | ||
397 | mutex_unlock(&mtd_table_mutex); | 397 | mutex_unlock(&mtd_table_mutex); |
398 | 398 | ||