From a9ac01c457e11615e69c2339a85815f4f5a31677 Mon Sep 17 00:00:00 2001 From: "J.P. Hutchins" Date: Wed, 21 Jun 2023 18:29:02 -0700 Subject: [PATCH] drivers: flash: add LOG_ERR for pin init -ENODEV returned in 4 cases, logs can distinguish Signed-off-by: J.P. Hutchins --- drivers/flash/spi_nor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/flash/spi_nor.c b/drivers/flash/spi_nor.c index bb37f0d47f3..4032e9bd4a1 100644 --- a/drivers/flash/spi_nor.c +++ b/drivers/flash/spi_nor.c @@ -1358,9 +1358,11 @@ static int spi_nor_init(const struct device *dev) #if ANY_INST_HAS_WP_GPIOS if (cfg->wp) { if (!device_is_ready(cfg->wp->port)) { + LOG_ERR("Write-protect pin not ready"); return -ENODEV; } if (gpio_pin_configure_dt(cfg->wp, GPIO_OUTPUT_ACTIVE)) { + LOG_ERR("Write-protect pin failed to set active") return -ENODEV; } } @@ -1368,9 +1370,11 @@ static int spi_nor_init(const struct device *dev) #if ANY_INST_HAS_HOLD_GPIOS if (cfg->hold) { if (!device_is_ready(cfg->hold->port)) { + LOG_ERR("Hold pin not ready"); return -ENODEV; } if (gpio_pin_configure_dt(cfg->hold, GPIO_OUTPUT_INACTIVE)) { + LOG_ERR("Hold pin failed to set inactive") return -ENODEV; } }