|
@@ -1814,13 +1814,13 @@ static int sunxi_nand_hw_common_ecc_ctrl_init(struct mtd_info *mtd,
|
|
int ret;
|
|
int ret;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ if (ecc->size != 512 && ecc->size != 1024)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
|
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
|
if (!data)
|
|
if (!data)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
- if (ecc->size != 512 && ecc->size != 1024)
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
/* Prefer 1k ECC chunk over 512 ones */
|
|
/* Prefer 1k ECC chunk over 512 ones */
|
|
if (ecc->size == 512 && mtd->writesize > 512) {
|
|
if (ecc->size == 512 && mtd->writesize > 512) {
|
|
ecc->size = 1024;
|
|
ecc->size = 1024;
|