aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 13:20:31 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 13:20:31 -0500
commita8e98d6d51a3eb7bb061b1625193a129c8bd094f (patch)
tree0fa58b6e11e37023b024e55b8f0e7e01438706d4 /drivers/mtd/ubi/scan.c
parentf0f1b3364ae7f48084bdf2837fb979ff59622523 (diff)
parentf9f7dd222364a6428d2ad99a515935dd1dd89d18 (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (120 commits) [MTD] Fix mtdoops.c compilation [MTD] [NOR] fix startup lock when using multiple nor flash chips [MTD] [DOC200x] eccbuf is statically defined and always evaluate to true [MTD] Fix maps/physmap.c compilation with CONFIG_PM [MTD] onenand: Add panic_write function to the onenand driver [MTD] mtdoops: Use the panic_write function when present [MTD] Add mtd panic_write function pointer [MTD] [NAND] Freescale enhanced Local Bus Controller FCM NAND support. [MTD] physmap.c: Add support for multiple resources [MTD] [NAND] Fix misparenthesization introduced by commit 78b65179... [MTD] [NAND] Fix Blackfin NFC ECC calculating bug with page size 512 bytes [MTD] [NAND] Remove wrong operation in PM function of the BF54x NFC driver [MTD] [NAND] Remove unused variable in plat_nand_remove [MTD] Unlocking all Intel flash that is locked on power up. [MTD] [NAND] at91_nand: Make mtdparts option can override board info [MTD] mtdoops: Various minor cleanups [MTD] mtdoops: Ensure sequential write to the buffer [MTD] mtdoops: Perform write operations in a workqueue [MTD] mtdoops: Add further error return code checking [MTD] [NOR] Test devtype, not definition in flash_probe(), drivers/mtd/devices/lart.c ...
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index c7b0afc9d280..05aa3e7daba1 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -286,9 +286,14 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
286 * FIXME: but this is anyway obsolete and will be removed at 286 * FIXME: but this is anyway obsolete and will be removed at
287 * some point. 287 * some point.
288 */ 288 */
289
290 dbg_bld("using old crappy leb_ver stuff"); 289 dbg_bld("using old crappy leb_ver stuff");
291 290
291 if (v1 == v2) {
292 ubi_err("PEB %d and PEB %d have the same version %lld",
293 seb->pnum, pnum, v1);
294 return -EINVAL;
295 }
296
292 abs = v1 - v2; 297 abs = v1 - v2;
293 if (abs < 0) 298 if (abs < 0)
294 abs = -abs; 299 abs = -abs;
@@ -390,7 +395,6 @@ out_free_buf:
390 vfree(buf); 395 vfree(buf);
391out_free_vidh: 396out_free_vidh:
392 ubi_free_vid_hdr(ubi, vh); 397 ubi_free_vid_hdr(ubi, vh);
393 ubi_assert(err < 0);
394 return err; 398 return err;
395} 399}
396 400
@@ -769,7 +773,7 @@ struct ubi_scan_leb *ubi_scan_get_free_peb(struct ubi_device *ubi,
769 */ 773 */
770static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum) 774static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum)
771{ 775{
772 long long ec; 776 long long uninitialized_var(ec);
773 int err, bitflips = 0, vol_id, ec_corr = 0; 777 int err, bitflips = 0, vol_id, ec_corr = 0;
774 778
775 dbg_bld("scan PEB %d", pnum); 779 dbg_bld("scan PEB %d", pnum);
@@ -854,7 +858,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum
854 } 858 }
855 859
856 vol_id = be32_to_cpu(vidh->vol_id); 860 vol_id = be32_to_cpu(vidh->vol_id);
857 if (vol_id > UBI_MAX_VOLUMES && vol_id != UBI_LAYOUT_VOL_ID) { 861 if (vol_id > UBI_MAX_VOLUMES && vol_id != UBI_LAYOUT_VOLUME_ID) {
858 int lnum = be32_to_cpu(vidh->lnum); 862 int lnum = be32_to_cpu(vidh->lnum);
859 863
860 /* Unsupported internal volume */ 864 /* Unsupported internal volume */