diff options
Diffstat (limited to 'drivers/mtd/nand/sunxi_nand.c')
-rw-r--r-- | drivers/mtd/nand/sunxi_nand.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c index d2b7457d447f..e414b31b71c1 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c | |||
@@ -1814,13 +1814,13 @@ static int sunxi_nand_hw_common_ecc_ctrl_init(struct mtd_info *mtd, | |||
1814 | int ret; | 1814 | int ret; |
1815 | int i; | 1815 | int i; |
1816 | 1816 | ||
1817 | if (ecc->size != 512 && ecc->size != 1024) | ||
1818 | return -EINVAL; | ||
1819 | |||
1817 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 1820 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
1818 | if (!data) | 1821 | if (!data) |
1819 | return -ENOMEM; | 1822 | return -ENOMEM; |
1820 | 1823 | ||
1821 | if (ecc->size != 512 && ecc->size != 1024) | ||
1822 | return -EINVAL; | ||
1823 | |||
1824 | /* Prefer 1k ECC chunk over 512 ones */ | 1824 | /* Prefer 1k ECC chunk over 512 ones */ |
1825 | if (ecc->size == 512 && mtd->writesize > 512) { | 1825 | if (ecc->size == 512 && mtd->writesize > 512) { |
1826 | ecc->size = 1024; | 1826 | ecc->size = 1024; |