aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-10-06 09:14:16 -0400
committerRichard Weinberger <richard@nod.at>2015-03-26 17:45:56 -0400
commit84b678f497c6eda650f0640bd7cf165e2c1acb49 (patch)
treeecf988ffbf6dd30f63ed4099aae3fd3708c575e6
parent5e0246e332349751d39d186ea0b7ec1e371ab2f8 (diff)
UBI: Fastmap: Fix fastmap usage in ubi_volume_notify()
There is no need to switch to ro mode if ubi_update_fastmap() fails. Also get rid of the ifdef. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
-rw-r--r--drivers/mtd/ubi/build.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index ba01a8d22d28..112a66c65966 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -154,23 +154,22 @@ static struct device_attribute dev_mtd_num =
154 */ 154 */
155int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype) 155int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol, int ntype)
156{ 156{
157 int ret;
157 struct ubi_notification nt; 158 struct ubi_notification nt;
158 159
159 ubi_do_get_device_info(ubi, &nt.di); 160 ubi_do_get_device_info(ubi, &nt.di);
160 ubi_do_get_volume_info(ubi, vol, &nt.vi); 161 ubi_do_get_volume_info(ubi, vol, &nt.vi);
161 162
162#ifdef CONFIG_MTD_UBI_FASTMAP
163 switch (ntype) { 163 switch (ntype) {
164 case UBI_VOLUME_ADDED: 164 case UBI_VOLUME_ADDED:
165 case UBI_VOLUME_REMOVED: 165 case UBI_VOLUME_REMOVED:
166 case UBI_VOLUME_RESIZED: 166 case UBI_VOLUME_RESIZED:
167 case UBI_VOLUME_RENAMED: 167 case UBI_VOLUME_RENAMED:
168 if (ubi_update_fastmap(ubi)) { 168 ret = ubi_update_fastmap(ubi);
169 ubi_err(ubi, "Unable to update fastmap!"); 169 if (ret)
170 ubi_ro_mode(ubi); 170 ubi_msg(ubi, "Unable to write a new fastmap: %i", ret);
171 }
172 } 171 }
173#endif 172
174 return blocking_notifier_call_chain(&ubi_notifiers, ntype, &nt); 173 return blocking_notifier_call_chain(&ubi_notifiers, ntype, &nt);
175} 174}
176 175