Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336226
b: refs/heads/master
c: 894aef2
h: refs/heads/master
v: v3
  • Loading branch information
Richard Weinberger authored and Artem Bityutskiy committed Dec 4, 2012
1 parent e7954fa commit d1499ac
Show file tree
Hide file tree
Showing 2 changed files with 10 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: ed4b7021cb51fe5a0f260df03298709347a26967
refs/heads/master: 894aef215775b56b725e9dde856b7a8b091ddfcc
18 changes: 9 additions & 9 deletions trunk/drivers/mtd/ubi/wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ struct ubi_wl_entry *ubi_wl_get_fm_peb(struct ubi_device *ubi, int anchor)
* @ubi: UBI device description object
*
* This function returns a physical eraseblock in case of success and a
* negative error code in case of failure. Might sleep.
* negative error code in case of failure.
*/
static int __wl_get_peb(struct ubi_device *ubi)
{
Expand Down Expand Up @@ -540,13 +540,6 @@ static int __wl_get_peb(struct ubi_device *ubi)
* ubi_wl_get_peb() after removing e from the pool. */
prot_queue_add(ubi, e);
#endif
err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
ubi->peb_size - ubi->vid_hdr_aloffset);
if (err) {
ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum);
return err;
}

return e->pnum;
}

Expand Down Expand Up @@ -690,12 +683,19 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi)

int ubi_wl_get_peb(struct ubi_device *ubi)
{
int peb;
int peb, err;

spin_lock(&ubi->wl_lock);
peb = __wl_get_peb(ubi);
spin_unlock(&ubi->wl_lock);

err = ubi_self_check_all_ff(ubi, peb, ubi->vid_hdr_aloffset,
ubi->peb_size - ubi->vid_hdr_aloffset);
if (err) {
ubi_err("new PEB %d does not contain all 0xFF bytes", peb);
return err;
}

return peb;
}
#endif
Expand Down

0 comments on commit d1499ac

Please sign in to comment.