Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174348
b: refs/heads/master
c: 6afaf8a
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and Artem Bityutskiy committed Dec 4, 2009
1 parent 206051e commit e274fa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 949cb6232d5fc9fa77cfa441418e12d6f9de163e
refs/heads/master: 6afaf8a484cbbfd2ccf58a4e5396d1f280469789
20 changes: 11 additions & 9 deletions trunk/drivers/mtd/ubi/upd.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@ int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,
}

if (bytes == 0) {
err = ubi_wl_flush(ubi);
if (err)
return err;

err = clear_update_marker(ubi, vol, 0);
if (err)
return err;
err = ubi_wl_flush(ubi);
if (!err)
vol->updating = 0;
vol->updating = 0;
}

vol->upd_buf = vmalloc(ubi->leb_size);
Expand Down Expand Up @@ -362,16 +364,16 @@ int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,

ubi_assert(vol->upd_received <= vol->upd_bytes);
if (vol->upd_received == vol->upd_bytes) {
err = ubi_wl_flush(ubi);
if (err)
return err;
/* The update is finished, clear the update marker */
err = clear_update_marker(ubi, vol, vol->upd_bytes);
if (err)
return err;
err = ubi_wl_flush(ubi);
if (err == 0) {
vol->updating = 0;
err = to_write;
vfree(vol->upd_buf);
}
vol->updating = 0;
err = to_write;
vfree(vol->upd_buf);
}

return err;
Expand Down

0 comments on commit e274fa7

Please sign in to comment.