From ff450cd7f48b2d04d3557164e83a185ac7c0a402 Mon Sep 17 00:00:00 2001 From: Joshua DeWeese Date: Mon, 22 May 2023 12:16:01 -0400 Subject: [PATCH] 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. --- drivers/mtd_spi_nor/mtd_spi_nor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd_spi_nor/mtd_spi_nor.c b/drivers/mtd_spi_nor/mtd_spi_nor.c index 9e75bd7b02..03d35661cf 100644 --- a/drivers/mtd_spi_nor/mtd_spi_nor.c +++ b/drivers/mtd_spi_nor/mtd_spi_nor.c @@ -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 */