[PATCH] spi: spi-qpic-snand: remove 'ecc_buf_cfg' member of struct 'qpic_ecc'

From: Gabor Juhos

Date: Tue Sep 29 2026 - 07:09:52 EST


The 'ecc_buf_cfg' member of struct 'qpic_ecc' is used to store
a configuration value for the QPIC_EBI2_ECC_BUF_CFG register.
However that register is obsolete on the QPIC v2 controller the
driver is written for and programming of the register has been
removed in commit 930a7312c946 ("spi: spi-qpic-snand: avoid
writing QPIC_EBI2_ECC_BUF_CFG register").

Since thaen, the value stored in 'ecc_buf_cfg' has no real use,
so drop the member from the structure. Also remove the remaining
code which uses that.

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

diff --git a/drivers/spi/spi-qpic-snand.c b/drivers/spi/spi-qpic-snand.c
index edfac4866a96..00072c44db7a 100644
--- a/drivers/spi/spi-qpic-snand.c
+++ b/drivers/spi/spi-qpic-snand.c
@@ -97,7 +97,6 @@ struct qpic_ecc {
u32 cfg1;
u32 cfg0_raw;
u32 cfg1_raw;
- u32 ecc_buf_cfg;
u32 ecc_bch_cfg;
bool bch_enabled;
};
@@ -407,8 +406,6 @@ static int qcom_spi_ecc_init_ctx_pipelined(struct nand_device *nand)
FIELD_PREP(ECC_MODE_MASK, ecc_cfg->ecc_mode) |
FIELD_PREP(ECC_PARITY_SIZE_BYTES_BCH_MASK, ecc_cfg->ecc_bytes_hw);

- ecc_cfg->ecc_buf_cfg = FIELD_PREP(NUM_STEPS_MASK, 0x203);
-
conf->step_size = ecc_cfg->step_size;
conf->strength = ecc_cfg->strength;

@@ -1198,13 +1195,12 @@ static int qcom_spi_program_ecc(struct qcom_nand_controller *snandc,
u8 *data_buf = NULL, *oob_buf = NULL;
int i, ret;
int num_cw = snandc->qspi->num_cw;
- u32 cfg0, cfg1, ecc_bch_cfg, ecc_buf_cfg;
+ u32 cfg0, cfg1, ecc_bch_cfg;

cfg0 = (ecc_cfg->cfg0 & ~CW_PER_PAGE_MASK) |
FIELD_PREP(CW_PER_PAGE_MASK, num_cw - 1);
cfg1 = ecc_cfg->cfg1;
ecc_bch_cfg = ecc_cfg->ecc_bch_cfg;
- ecc_buf_cfg = ecc_cfg->ecc_buf_cfg;

if (snandc->qspi->data_buf)
data_buf = snandc->qspi->data_buf;
@@ -1222,7 +1218,6 @@ static int qcom_spi_program_ecc(struct qcom_nand_controller *snandc,
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->ecc_buf_cfg = cpu_to_le32(ecc_buf_cfg);
snandc->regs->exec = cpu_to_le32(1);

qcom_spi_config_page_write(snandc);
@@ -1275,13 +1270,12 @@ static int qcom_spi_program_oob(struct qcom_nand_controller *snandc,
u8 *oob_buf = NULL;
int ret, col, data_size, oob_size;
int num_cw = snandc->qspi->num_cw;
- u32 cfg0, cfg1, ecc_bch_cfg, ecc_buf_cfg;
+ u32 cfg0, cfg1, ecc_bch_cfg;

cfg0 = (ecc_cfg->cfg0 & ~CW_PER_PAGE_MASK) |
FIELD_PREP(CW_PER_PAGE_MASK, 0);
cfg1 = ecc_cfg->cfg1;
ecc_bch_cfg = ecc_cfg->ecc_bch_cfg;
- ecc_buf_cfg = ecc_cfg->ecc_buf_cfg;

col = ecc_cfg->cw_size * (num_cw - 1);

@@ -1297,7 +1291,6 @@ static int qcom_spi_program_oob(struct qcom_nand_controller *snandc,
snandc->regs->cfg0 = cpu_to_le32(cfg0);
snandc->regs->cfg1 = cpu_to_le32(cfg1);
snandc->regs->ecc_bch_cfg = cpu_to_le32(ecc_bch_cfg);
- snandc->regs->ecc_buf_cfg = cpu_to_le32(ecc_buf_cfg);
snandc->regs->exec = cpu_to_le32(1);

/* calculate the data and oob size for the last codeword/step */

---
base-commit: f3c0a2b557ea87cbd802b278783c32484a063ded
change-id: 20260929-qpic-snand-drop-ecc_buf_cfg-bf07142c2d62

Best regards,
--
Gabor Juhos <j4g8y7@xxxxxxxxx>