Skip to content

Commit 0538041

Browse files
de-nordiccarlescufi
authored andcommitted
drivers: flash: nrf_qspi_nor: Process ret of qspi_device_init
Commit slters z_impl_nrf_qspi_nor_xip_enable to not call qspi_device_init in case when xip_enabled has the same value as requested. In case when qspi_device_init returns non-zero no further actions are taken and xip_enabled will not be to set requested value. Fixes #59535. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 243e84d commit 0538041

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/flash/nrf_qspi_nor.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,18 @@ static int qspi_nor_pm_action(const struct device *dev,
14211421
void z_impl_nrf_qspi_nor_xip_enable(const struct device *dev, bool enable)
14221422
{
14231423
struct qspi_nor_data *dev_data = dev->data;
1424+
int ret;
1425+
1426+
if (dev_data->xip_enabled == enable) {
1427+
return;
1428+
}
14241429

1425-
qspi_device_init(dev);
1430+
ret = qspi_device_init(dev);
1431+
1432+
if (ret != 0) {
1433+
LOG_ERR("NRF QSPI NOR XIP %s failed with %d\n", enable ? "enable" : "disable", ret);
1434+
return;
1435+
}
14261436

14271437
#if NRF_QSPI_HAS_XIPEN
14281438
nrf_qspi_xip_set(NRF_QSPI, enable);

0 commit comments

Comments
 (0)