aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/ubi/vtbl.c5
-rw-r--r--drivers/mtd/ubi/wl.c9
2 files changed, 5 insertions, 9 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index a37dc7a213b..7a1a8a1da61 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -115,9 +115,8 @@ int ubi_change_vtbl_record(struct ubi_device *ubi, int idx,
115} 115}
116 116
117/** 117/**
118 * vol_til_check - check if volume table is not corrupted and contains sensible 118 * vtbl_check - check if volume table is not corrupted and contains sensible
119 * data. 119 * data.
120 *
121 * @ubi: UBI device description object 120 * @ubi: UBI device description object
122 * @vtbl: volume table 121 * @vtbl: volume table
123 * 122 *
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 8421c7a9a83..7d32f71d6f1 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -259,7 +259,6 @@ static int do_work(struct ubi_device *ubi)
259 */ 259 */
260 down_read(&ubi->work_sem); 260 down_read(&ubi->work_sem);
261 spin_lock(&ubi->wl_lock); 261 spin_lock(&ubi->wl_lock);
262
263 if (list_empty(&ubi->works)) { 262 if (list_empty(&ubi->works)) {
264 spin_unlock(&ubi->wl_lock); 263 spin_unlock(&ubi->wl_lock);
265 up_read(&ubi->work_sem); 264 up_read(&ubi->work_sem);
@@ -268,6 +267,8 @@ static int do_work(struct ubi_device *ubi)
268 267
269 wrk = list_entry(ubi->works.next, struct ubi_work, list); 268 wrk = list_entry(ubi->works.next, struct ubi_work, list);
270 list_del(&wrk->list); 269 list_del(&wrk->list);
270 ubi->works_count -= 1;
271 ubi_assert(ubi->works_count >= 0);
271 spin_unlock(&ubi->wl_lock); 272 spin_unlock(&ubi->wl_lock);
272 273
273 /* 274 /*
@@ -278,12 +279,8 @@ static int do_work(struct ubi_device *ubi)
278 err = wrk->func(ubi, wrk, 0); 279 err = wrk->func(ubi, wrk, 0);
279 if (err) 280 if (err)
280 ubi_err("work failed with error code %d", err); 281 ubi_err("work failed with error code %d", err);
281
282 spin_lock(&ubi->wl_lock);
283 ubi->works_count -= 1;
284 ubi_assert(ubi->works_count >= 0);
285 spin_unlock(&ubi->wl_lock);
286 up_read(&ubi->work_sem); 282 up_read(&ubi->work_sem);
283
287 return err; 284 return err;
288} 285}
289 286