spi: nrfx_spi*: only run uninit if configured
Only run the `uninit` function if the SPI instance has previously been configured. This stops an assertion in the HAL drivers from triggering due to running `uninit` without a previous `init`. Fixes #42299. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
parent
f759c813bb
commit
fdc25cd44c
2 changed files with 8 additions and 4 deletions
|
@ -285,8 +285,10 @@ static int spi_nrfx_pm_action(const struct device *dev,
|
|||
break;
|
||||
|
||||
case PM_DEVICE_ACTION_SUSPEND:
|
||||
nrfx_spi_uninit(&config->spi);
|
||||
if (data->initialized) {
|
||||
nrfx_spi_uninit(&config->spim);
|
||||
data->initialized = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -443,8 +443,10 @@ static int spim_nrfx_pm_action(const struct device *dev,
|
|||
break;
|
||||
|
||||
case PM_DEVICE_ACTION_SUSPEND:
|
||||
if (data->initialized) {
|
||||
nrfx_spim_uninit(&config->spim);
|
||||
data->initialized = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue