Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45a9e5ac authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mtd: msm_qpic_nand: Use flash device ECC capability for erase page"

parents 1b3be85b b28af78e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1995,7 +1995,7 @@ static int msm_nand_is_erased_page_ps(struct mtd_info *mtd, loff_t from,
			if (last_pos < ecc_bytes_percw_in_bits)
				num_zero_bits++;

			if (num_zero_bits > MAX_ECC_BIT_FLIPS) {
			if (num_zero_bits > info->flash_dev.ecc_capability) {
				*erased_page = false;
				goto free_mem;
			}
@@ -2007,7 +2007,8 @@ static int msm_nand_is_erased_page_ps(struct mtd_info *mtd, loff_t from,
		ecc_temp += chip->ecc_parity_bytes;
	}

	if ((n == cwperpage) && (num_zero_bits <= MAX_ECC_BIT_FLIPS))
	if ((n == cwperpage) &&
			(num_zero_bits <= info->flash_dev.ecc_capability))
		*erased_page = true;
free_mem:
	kfree(ecc);
@@ -2662,7 +2663,7 @@ static int msm_nand_is_erased_page(struct mtd_info *mtd, loff_t from,
			if (last_pos < ecc_bytes_percw_in_bits)
				num_zero_bits++;

			if (num_zero_bits > MAX_ECC_BIT_FLIPS) {
			if (num_zero_bits > info->flash_dev.ecc_capability) {
				*erased_page = false;
				goto free_mem;
			}
@@ -2674,7 +2675,8 @@ static int msm_nand_is_erased_page(struct mtd_info *mtd, loff_t from,
		ecc_temp += chip->ecc_parity_bytes;
	}

	if ((n == cwperpage) && (num_zero_bits <= MAX_ECC_BIT_FLIPS))
	if ((n == cwperpage) &&
			(num_zero_bits <= info->flash_dev.ecc_capability))
		*erased_page = true;
free_mem:
	kfree(ecc);