Skip to content

Commit a9ac01c

Browse files
JPHutchinscarlescufi
authored andcommitted
drivers: flash: add LOG_ERR for pin init
-ENODEV returned in 4 cases, logs can distinguish Signed-off-by: J.P. Hutchins <[email protected]>
1 parent 477ff70 commit a9ac01c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/flash/spi_nor.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,19 +1358,23 @@ static int spi_nor_init(const struct device *dev)
13581358
#if ANY_INST_HAS_WP_GPIOS
13591359
if (cfg->wp) {
13601360
if (!device_is_ready(cfg->wp->port)) {
1361+
LOG_ERR("Write-protect pin not ready");
13611362
return -ENODEV;
13621363
}
13631364
if (gpio_pin_configure_dt(cfg->wp, GPIO_OUTPUT_ACTIVE)) {
1365+
LOG_ERR("Write-protect pin failed to set active")
13641366
return -ENODEV;
13651367
}
13661368
}
13671369
#endif /* ANY_INST_HAS_WP_GPIOS */
13681370
#if ANY_INST_HAS_HOLD_GPIOS
13691371
if (cfg->hold) {
13701372
if (!device_is_ready(cfg->hold->port)) {
1373+
LOG_ERR("Hold pin not ready");
13711374
return -ENODEV;
13721375
}
13731376
if (gpio_pin_configure_dt(cfg->hold, GPIO_OUTPUT_INACTIVE)) {
1377+
LOG_ERR("Hold pin failed to set inactive")
13741378
return -ENODEV;
13751379
}
13761380
}

0 commit comments

Comments
 (0)