aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/upd.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2012-05-14 11:55:51 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-20 13:25:59 -0400
commitb36a261e8c0ab323d04db9cdd1f6bb4c273c4b32 (patch)
tree00c90c5fa556f335338f4f61c808d4dfe502bb74 /drivers/mtd/ubi/upd.c
parent0964f6a27b3574d9210c59ec883cbb3fff78a78d (diff)
UBI: Kill data type hint
We do not need this feature and to our shame it even was not working and there was a bug found very recently. -- Artem Bityutskiy Without the data type hint UBI2 (fastmap) will be easier to implement. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/upd.c')
-rw-r--r--drivers/mtd/ubi/upd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
index 425bf5a3edd4..11a28f9ce0db 100644
--- a/drivers/mtd/ubi/upd.c
+++ b/drivers/mtd/ubi/upd.c
@@ -186,14 +186,12 @@ int ubi_start_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
186 dbg_gen("start changing LEB %d:%d, %u bytes", 186 dbg_gen("start changing LEB %d:%d, %u bytes",
187 vol->vol_id, req->lnum, req->bytes); 187 vol->vol_id, req->lnum, req->bytes);
188 if (req->bytes == 0) 188 if (req->bytes == 0)
189 return ubi_eba_atomic_leb_change(ubi, vol, req->lnum, NULL, 0, 189 return ubi_eba_atomic_leb_change(ubi, vol, req->lnum, NULL, 0);
190 req->dtype);
191 190
192 vol->upd_bytes = req->bytes; 191 vol->upd_bytes = req->bytes;
193 vol->upd_received = 0; 192 vol->upd_received = 0;
194 vol->changing_leb = 1; 193 vol->changing_leb = 1;
195 vol->ch_lnum = req->lnum; 194 vol->ch_lnum = req->lnum;
196 vol->ch_dtype = req->dtype;
197 195
198 vol->upd_buf = vmalloc(req->bytes); 196 vol->upd_buf = vmalloc(req->bytes);
199 if (!vol->upd_buf) 197 if (!vol->upd_buf)
@@ -246,8 +244,7 @@ static int write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
246 return 0; 244 return 0;
247 } 245 }
248 246
249 err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, len, 247 err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, len);
250 UBI_UNKNOWN);
251 } else { 248 } else {
252 /* 249 /*
253 * When writing static volume, and this is the last logical 250 * When writing static volume, and this is the last logical
@@ -259,8 +256,7 @@ static int write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
259 * contain zeros, not random trash. 256 * contain zeros, not random trash.
260 */ 257 */
261 memset(buf + len, 0, vol->usable_leb_size - len); 258 memset(buf + len, 0, vol->usable_leb_size - len);
262 err = ubi_eba_write_leb_st(ubi, vol, lnum, buf, len, 259 err = ubi_eba_write_leb_st(ubi, vol, lnum, buf, len, used_ebs);
263 UBI_UNKNOWN, used_ebs);
264 } 260 }
265 261
266 return err; 262 return err;
@@ -421,7 +417,7 @@ int ubi_more_leb_change_data(struct ubi_device *ubi, struct ubi_volume *vol,
421 len - vol->upd_bytes); 417 len - vol->upd_bytes);
422 len = ubi_calc_data_len(ubi, vol->upd_buf, len); 418 len = ubi_calc_data_len(ubi, vol->upd_buf, len);
423 err = ubi_eba_atomic_leb_change(ubi, vol, vol->ch_lnum, 419 err = ubi_eba_atomic_leb_change(ubi, vol, vol->ch_lnum,
424 vol->upd_buf, len, UBI_UNKNOWN); 420 vol->upd_buf, len);
425 if (err) 421 if (err)
426 return err; 422 return err;
427 } 423 }