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 <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2023-07-11 12:07:00 +00:00 committed by Carles Cufí
commit 0538041cd6

View file

@ -1421,8 +1421,18 @@ static int qspi_nor_pm_action(const struct device *dev,
void z_impl_nrf_qspi_nor_xip_enable(const struct device *dev, bool enable)
{
struct qspi_nor_data *dev_data = dev->data;
int ret;
qspi_device_init(dev);
if (dev_data->xip_enabled == enable) {
return;
}
ret = qspi_device_init(dev);
if (ret != 0) {
LOG_ERR("NRF QSPI NOR XIP %s failed with %d\n", enable ? "enable" : "disable", ret);
return;
}
#if NRF_QSPI_HAS_XIPEN
nrf_qspi_xip_set(NRF_QSPI, enable);