]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mtd/ubi/build.c
Update from 2013.01 to 2013.07
[karo-tx-uboot.git] / drivers / mtd / ubi / build.c
index d144ac29bc5f21c1ac84c1932802f6579a796565..6d86c0b6bcfed229152f009701a4a228c14e51b4 100644 (file)
@@ -2,19 +2,7 @@
  * Copyright (c) International Business Machines Corp., 2006
  * Copyright (c) Nokia Corporation, 2007
  *
- * 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+
  *
  * Author: Artem Bityutskiy (Битюцкий Артём),
  *         Frank Haverkamp
@@ -478,19 +466,19 @@ static int attach_by_scanning(struct ubi_device *ubi)
 
        err = ubi_eba_init_scan(ubi, si);
        if (err)
-               goto out_wl;
+               goto out_vtbl;
 
        err = ubi_wl_init_scan(ubi, si);
        if (err)
-               goto out_vtbl;
+               goto out_eba;
 
        ubi_scan_destroy_si(si);
        return 0;
 
+out_eba:
+       ubi_eba_close(ubi);
 out_vtbl:
        vfree(ubi->vtbl);
-out_wl:
-       ubi_wl_close(ubi);
 out_si:
        ubi_scan_destroy_si(si);
        return err;
@@ -539,7 +527,7 @@ static int io_init(struct ubi_device *ubi)
        ubi->peb_count  = mtd_div_by_eb(ubi->mtd->size, ubi->mtd);
        ubi->flash_size = ubi->mtd->size;
 
-       if (ubi->mtd->block_isbad && ubi->mtd->block_markbad)
+       if (mtd_can_have_bb(ubi->mtd))
                ubi->bad_allowed = 1;
 
        ubi->min_io_size = ubi->mtd->writesize;