drivers: flash: add LOG_ERR for pin init
-ENODEV returned in 4 cases, logs can distinguish Signed-off-by: J.P. Hutchins <jp@intercreate.io>
This commit is contained in:
parent
477ff70230
commit
a9ac01c457
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue