]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/ubi/wl.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[u-boot] / drivers / mtd / ubi / wl.c
index 2f9a5e3653e024012ea21a892afa494e5a7f4a86..1eaa88b36fef21ee15fb28e2b7f1aae423a9752a 100644 (file)
@@ -1,19 +1,7 @@
 /*
  * Copyright (c) International Business Machines Corp., 2006
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  *
  * Authors: Artem Bityutskiy (Битюцкий Артём), Thomas Gleixner
  */
@@ -696,8 +684,13 @@ static void schedule_ubi_work(struct ubi_device *ubi, struct ubi_work *wrk)
        list_add_tail(&wrk->list, &ubi->works);
        ubi_assert(ubi->works_count >= 0);
        ubi->works_count += 1;
-       if (ubi->thread_enabled)
-               wake_up_process(ubi->bgt_thread);
+
+       /*
+        * U-Boot special: We have no bgt_thread in U-Boot!
+        * So just call do_work() here directly.
+        */
+       do_work(ubi);
+
        spin_unlock(&ubi->wl_lock);
 }
 
@@ -1533,6 +1526,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
        if (ubi->avail_pebs < WL_RESERVED_PEBS) {
                ubi_err("no enough physical eraseblocks (%d, need %d)",
                        ubi->avail_pebs, WL_RESERVED_PEBS);
+               err = -ENOSPC;
                goto out_free;
        }
        ubi->avail_pebs -= WL_RESERVED_PEBS;