From 5b83b7a4723d6dd5f9c2376502b5c6e2cc161d51 Mon Sep 17 00:00:00 2001 From: Wei-Tai Lee Date: Mon, 29 Apr 2024 15:26:41 +0800 Subject: [PATCH] drivers: flash: andes_qspi: fix accessing error variable Fix accessing error variable when using FLASH_ANDES_QSPI_SFDP_RUNTIME. Signed-off-by: Wei-Tai Lee --- drivers/flash/flash_andes_qspi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/flash/flash_andes_qspi.c b/drivers/flash/flash_andes_qspi.c index 1bb77a8602..f8c7dfd96d 100644 --- a/drivers/flash/flash_andes_qspi.c +++ b/drivers/flash/flash_andes_qspi.c @@ -609,7 +609,7 @@ static int spi_nor_process_sfdp(const struct device *dev) .len_dw = config->bfp_len, }; - ret = spi_nor_process_bfp(dev, &bfp_hdr, cfg->bfp); + ret = spi_nor_process_bfp(dev, &bfp_hdr, config->bfp); #else #error Unhandled SFDP choice #endif @@ -825,10 +825,10 @@ static int flash_andes_qspi_init(const struct device *dev) #ifndef CONFIG_FLASH_ANDES_QSPI_SFDP_RUNTIME - if (memcmp(jedec_id, cfg->jedec_id, sizeof(jedec_id)) != 0) { + if (memcmp(jedec_id, config->jedec_id, sizeof(jedec_id)) != 0) { LOG_ERR("Device id %02x %02x %02x does not match config" "%02x %02x %02x", jedec_id[0], jedec_id[1], jedec_id[2], - cfg->jedec_id[0], cfg->jedec_id[1], cfg->jedec_id[2]); + config->jedec_id[0], config->jedec_id[1], config->jedec_id[2]); return -EINVAL; } #endif