[PATCH 7/7] spi: spi-qpic-snand: use the common 'qcom_nandc_read_stats' structure

From: Gabor Juhos

Date: Mon Nov 09 2026 - 14:43:11 EST


The 'qcom_nandc_read_stats' structure defined in the 'nand-qpic-common.h'
header and the locally defined 'snandc_read_status' structure are
identical type wise and both are serving the same purpose.

Drop the local structure and use the global one instead to reduce
duplication.

No functional changes.

Signed-off-by: Gabor Juhos <j4g8y7@xxxxxxxxx>
---
drivers/spi/spi-qpic-snand.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index 4105a04afcdb..6c5878f3f8b6 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -64,12 +64,6 @@
#define BAD_BLOCK_MARKER_SIZE 0x2
#define OOB_BUF_SIZE 128

-struct snandc_read_status {
- __le32 snandc_flash;
- __le32 snandc_buffer;
- __le32 snandc_erased_cw;
-};
-
/*
* ECC state struct
* @corrected: ECC corrected
@@ -610,7 +604,7 @@ static int qcom_spi_read_last_cw(struct qcom_nand_controller *snandc,

static int qcom_spi_check_error(struct qcom_nand_controller *snandc)
{
- struct snandc_read_status *buf;
+ struct qcom_nandc_read_stats *buf;
struct qpic_ecc *ecc_cfg = snandc->qspi->ecc;
int i, num_cw = snandc->qspi->num_cw;
bool flash_op_err = false, erased;
@@ -621,14 +615,14 @@ static int qcom_spi_check_error(struct qcom_nand_controller *snandc)
snandc->qspi->ecc_stats.corrected = 0;

qcom_nandc_dev_to_mem(snandc, true);
- buf = (struct snandc_read_status *)snandc->reg_read_buf;
+ buf = (struct qcom_nandc_read_stats *)snandc->reg_read_buf;

for (i = 0; i < num_cw; i++, buf++) {
u32 flash, buffer, erased_cw;

- flash = le32_to_cpu(buf->snandc_flash);
- buffer = le32_to_cpu(buf->snandc_buffer);
- erased_cw = le32_to_cpu(buf->snandc_erased_cw);
+ flash = le32_to_cpu(buf->flash);
+ buffer = le32_to_cpu(buf->buffer);
+ erased_cw = le32_to_cpu(buf->erased_cw);

if ((flash & FS_OP_ERR) && (buffer & BS_UNCORRECTABLE_BIT)) {
if (ecc_cfg->bch_enabled)

--
2.56.0