diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/ubi/wl.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 1f9f5f7a5d0f..2144f611196e 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -498,7 +498,7 @@ out: | |||
498 | * @ubi: UBI device description object | 498 | * @ubi: UBI device description object |
499 | * | 499 | * |
500 | * This function returns a physical eraseblock in case of success and a | 500 | * This function returns a physical eraseblock in case of success and a |
501 | * negative error code in case of failure. Might sleep. | 501 | * negative error code in case of failure. |
502 | */ | 502 | */ |
503 | static int __wl_get_peb(struct ubi_device *ubi) | 503 | static int __wl_get_peb(struct ubi_device *ubi) |
504 | { | 504 | { |
@@ -540,13 +540,6 @@ retry: | |||
540 | * ubi_wl_get_peb() after removing e from the pool. */ | 540 | * ubi_wl_get_peb() after removing e from the pool. */ |
541 | prot_queue_add(ubi, e); | 541 | prot_queue_add(ubi, e); |
542 | #endif | 542 | #endif |
543 | err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset, | ||
544 | ubi->peb_size - ubi->vid_hdr_aloffset); | ||
545 | if (err) { | ||
546 | ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum); | ||
547 | return err; | ||
548 | } | ||
549 | |||
550 | return e->pnum; | 543 | return e->pnum; |
551 | } | 544 | } |
552 | 545 | ||
@@ -690,12 +683,19 @@ static struct ubi_wl_entry *get_peb_for_wl(struct ubi_device *ubi) | |||
690 | 683 | ||
691 | int ubi_wl_get_peb(struct ubi_device *ubi) | 684 | int ubi_wl_get_peb(struct ubi_device *ubi) |
692 | { | 685 | { |
693 | int peb; | 686 | int peb, err; |
694 | 687 | ||
695 | spin_lock(&ubi->wl_lock); | 688 | spin_lock(&ubi->wl_lock); |
696 | peb = __wl_get_peb(ubi); | 689 | peb = __wl_get_peb(ubi); |
697 | spin_unlock(&ubi->wl_lock); | 690 | spin_unlock(&ubi->wl_lock); |
698 | 691 | ||
692 | err = ubi_self_check_all_ff(ubi, peb, ubi->vid_hdr_aloffset, | ||
693 | ubi->peb_size - ubi->vid_hdr_aloffset); | ||
694 | if (err) { | ||
695 | ubi_err("new PEB %d does not contain all 0xFF bytes", peb); | ||
696 | return err; | ||
697 | } | ||
698 | |||
699 | return peb; | 699 | return peb; |
700 | } | 700 | } |
701 | #endif | 701 | #endif |