1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-29 16:31:18 +01:00

drivers/mtd_spi_nor: fix hang

This patch releases the SPI bus when the memory devices is not found.
This frees the bus for other devices to use the bus. It also allows
future attempts to init the device.
This commit is contained in:
Joshua DeWeese 2023-05-22 12:16:01 -04:00
parent 33cb2f489b
commit ff450cd7f4

View File

@ -458,6 +458,7 @@ static int mtd_spi_nor_power(mtd_dev_t *mtd, enum mtd_power_state power)
retries++;
} while (res < 0 && retries < MTD_POWER_UP_WAIT_FOR_ID);
if (res < 0) {
mtd_spi_release(dev);
return -EIO;
}
/* enable 32 bit address mode */