]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/mtd/nand/nand_base.c
NAND: show manufacturer and device ID for unknown chips
[people/ms/u-boot.git] / drivers / mtd / nand / nand_base.c
index 6da261c0415b4b7954006aad9b7912ae55870464..ed1c9c9a88aa906b70dbd83698f7406e010dd774 100644 (file)
@@ -1061,7 +1061,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3
                int stat;
 
                stat = chip->ecc.correct(mtd, p, &chip->buffers->ecccode[i], &chip->buffers->ecccalc[i]);
-               if (stat < 0)
+               if (stat == -1)
                        mtd->ecc_stats.failed++;
                else
                        mtd->ecc_stats.corrected += stat;
@@ -2652,8 +2652,12 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
                }
        }
 
-       if (!type)
+       if (!type) {
+               printk(KERN_INFO "%s: unknown NAND device: Manufacturer ID:"
+                      " 0x%02x, Chip ID: 0x%02x\n", __func__,
+                      *maf_id, dev_id);
                return ERR_PTR(-ENODEV);
+       }
 
        if (!mtd->name)
                mtd->name = type->name;