diff --git a/drivers/flash/flash_stm32_ospi.c b/drivers/flash/flash_stm32_ospi.c index 8e6d671c759..26f82411789 100644 --- a/drivers/flash/flash_stm32_ospi.c +++ b/drivers/flash/flash_stm32_ospi.c @@ -2205,11 +2205,11 @@ static int flash_stm32_ospi_init(const struct device *dev) union { uint32_t dw[MIN(php->len_dw, 20)]; struct jesd216_bfp bfp; - } u; - const struct jesd216_bfp *bfp = &u.bfp; + } u2; + const struct jesd216_bfp *bfp = &u2.bfp; ret = ospi_read_sfdp(dev, jesd216_param_addr(php), - (uint8_t *)u.dw, sizeof(u.dw)); + (uint8_t *)u2.dw, sizeof(u2.dw)); if (ret == 0) { ret = spi_nor_process_bfp(dev, php, bfp); } diff --git a/drivers/flash/flash_stm32_qspi.c b/drivers/flash/flash_stm32_qspi.c index 74ea8bab7c7..5f8c8a0b218 100644 --- a/drivers/flash/flash_stm32_qspi.c +++ b/drivers/flash/flash_stm32_qspi.c @@ -1311,11 +1311,11 @@ static int flash_stm32_qspi_init(const struct device *dev) union { uint32_t dw[MIN(php->len_dw, 20)]; struct jesd216_bfp bfp; - } u; - const struct jesd216_bfp *bfp = &u.bfp; + } u2; + const struct jesd216_bfp *bfp = &u2.bfp; ret = qspi_read_sfdp(dev, jesd216_param_addr(php), - (uint8_t *)u.dw, sizeof(u.dw)); + (uint8_t *)u2.dw, sizeof(u2.dw)); if (ret == 0) { ret = spi_nor_process_bfp(dev, php, bfp); }