]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
NAND: Correct the "chip_shift" calculation
authorSandeep Paulraj <s-paulraj@ti.com>
Sat, 7 Nov 2009 19:24:06 +0000 (14:24 -0500)
committerScott Wood <scottwood@freescale.com>
Fri, 13 Nov 2009 22:56:15 +0000 (16:56 -0600)
This patch updates the "chip_shift" calculation in the
NAND driver. This is being done to sync up the NAND driver with
the kernel NAND driver.

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
drivers/mtd/nand/nand_base.c

index 30a3e9e742959c8c079b4a56834d984246de5ae6..d5c53fed1b9e987d6e4ec9c35ba67d92d0618888 100644 (file)
@@ -2628,7 +2628,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
        chip->bbt_erase_shift = chip->phys_erase_shift =
                ffs(mtd->erasesize) - 1;
        if (chip->chipsize & 0xffffffff)
-               chip->chip_shift = ffs(chip->chipsize) - 1;
+               chip->chip_shift = ffs((unsigned)chip->chipsize) - 1;
        else
                chip->chip_shift = ffs((unsigned)(chip->chipsize >> 32)) + 31;