diff options
author | Chris Malley <mail@chrismalley.co.uk> | 2008-05-19 20:11:50 +0100 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-06-04 17:53:31 +0100 |
commit | 71a928c0e52cedc43747c64b96a5f74592ab678f (patch) | |
tree | 98f4862294a23b859af87f6df44e9668a3fbc133 /drivers/mtd/mtdcore.c | |
parent | 59018b6d2acabb114ab58637e6ab95ba424a89d0 (diff) | |
download | linux-stable-71a928c0e52cedc43747c64b96a5f74592ab678f.tar.gz linux-stable-71a928c0e52cedc43747c64b96a5f74592ab678f.tar.bz2 linux-stable-71a928c0e52cedc43747c64b96a5f74592ab678f.zip |
[MTD] Use list_for_each_entry[_safe] where appropriate.
Janitorial work to remove temporary pointers and make some functions a bit
more readable.
Signed-off-by: Chris Malley <mail@chrismalley.co.uk>
Reviewed-By: Jörn Engel <joern@logfs.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r-- | drivers/mtd/mtdcore.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 4373790401d3..a9d246949820 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -70,9 +70,8 @@ int add_mtd_device(struct mtd_info *mtd) DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name); /* No need to get a refcount on the module containing the notifier, since we hold the mtd_table_mutex */ - list_for_each_entry(not, &mtd_notifiers, list) { + list_for_each_entry(not, &mtd_notifiers, list) not->add(mtd); - } mutex_unlock(&mtd_table_mutex); /* We _know_ we aren't being removed, because @@ -114,9 +113,8 @@ int del_mtd_device (struct mtd_info *mtd) /* No need to get a refcount on the module containing the notifier, since we hold the mtd_table_mutex */ - list_for_each_entry(not, &mtd_notifiers, list) { + list_for_each_entry(not, &mtd_notifiers, list) not->remove(mtd); - } mtd_table[mtd->index] = NULL; |