diff options
author | Chris Malley <mail@chrismalley.co.uk> | 2008-05-19 15:11:50 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-06-04 12:53:31 -0400 |
commit | 71a928c0e52cedc43747c64b96a5f74592ab678f (patch) | |
tree | 98f4862294a23b859af87f6df44e9668a3fbc133 /drivers/mtd/mtdcore.c | |
parent | 59018b6d2acabb114ab58637e6ab95ba424a89d0 (diff) |
[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 4373790401d..a9d24694982 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c | |||
@@ -70,9 +70,8 @@ int add_mtd_device(struct mtd_info *mtd) | |||
70 | DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name); | 70 | DEBUG(0, "mtd: Giving out device %d to %s\n",i, mtd->name); |
71 | /* No need to get a refcount on the module containing | 71 | /* No need to get a refcount on the module containing |
72 | the notifier, since we hold the mtd_table_mutex */ | 72 | the notifier, since we hold the mtd_table_mutex */ |
73 | list_for_each_entry(not, &mtd_notifiers, list) { | 73 | list_for_each_entry(not, &mtd_notifiers, list) |
74 | not->add(mtd); | 74 | not->add(mtd); |
75 | } | ||
76 | 75 | ||
77 | mutex_unlock(&mtd_table_mutex); | 76 | mutex_unlock(&mtd_table_mutex); |
78 | /* We _know_ we aren't being removed, because | 77 | /* We _know_ we aren't being removed, because |
@@ -114,9 +113,8 @@ int del_mtd_device (struct mtd_info *mtd) | |||
114 | 113 | ||
115 | /* No need to get a refcount on the module containing | 114 | /* No need to get a refcount on the module containing |
116 | the notifier, since we hold the mtd_table_mutex */ | 115 | the notifier, since we hold the mtd_table_mutex */ |
117 | list_for_each_entry(not, &mtd_notifiers, list) { | 116 | list_for_each_entry(not, &mtd_notifiers, list) |
118 | not->remove(mtd); | 117 | not->remove(mtd); |
119 | } | ||
120 | 118 | ||
121 | mtd_table[mtd->index] = NULL; | 119 | mtd_table[mtd->index] = NULL; |
122 | 120 | ||