[PATCH v2 1/7] spi: spi-qpic-snand: use the common qcom_nandc_check_flash_errors() function
From: Gabor Juhos
Date: Wed Dec 02 2026 - 15:40:59 EST
The common function from the 'qpic_common' module provides the same
functionality as the locally implemented counterpart.
Use the common function and remove the local one in order to reduce
code duplication.
No functional changes intended.
Signed-off-by: Gabor Juhos <j4g8y7@xxxxxxxxx>
---
Changes in v2:
- No change.
---
drivers/spi/spi-qpic-snand.c | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index 6cb6e02d2498b..1f5d67c9be36d 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -603,22 +603,6 @@ static void qcom_spi_config_single_cw_page_read(struct qcom_nand_controller *sna
qcom_read_reg_dma(snandc, NAND_FLASH_STATUS, 1, 0);
}
-static int qcom_spi_check_raw_flash_errors(struct qcom_nand_controller *snandc, int cw_cnt)
-{
- int i;
-
- qcom_nandc_dev_to_mem(snandc, true);
-
- for (i = 0; i < cw_cnt; i++) {
- u32 flash = le32_to_cpu(snandc->reg_read_buf[i]);
-
- if (flash & (FS_OP_ERR | FS_MPU_ERR))
- return -EIO;
- }
-
- return 0;
-}
-
static int qcom_spi_read_last_cw(struct qcom_nand_controller *snandc,
const struct spi_mem_op *op)
{
@@ -662,7 +646,7 @@ static int qcom_spi_read_last_cw(struct qcom_nand_controller *snandc,
return ret;
}
- ret = qcom_spi_check_raw_flash_errors(snandc, 1);
+ ret = qcom_nandc_check_flash_errors(snandc, 1);
if (ret)
return ret;
@@ -830,7 +814,7 @@ static int qcom_spi_read_cw_raw(struct qcom_nand_controller *snandc, u8 *data_bu
return ret;
}
- return qcom_spi_check_raw_flash_errors(snandc, 1);
+ return qcom_nandc_check_flash_errors(snandc, 1);
}
static int qcom_spi_read_page_raw(struct qcom_nand_controller *snandc,
--
2.56.1