forked from espressif/esp-idf
fix(spi_flash): Return false directly in suspend caps check
This commit is contained in:
@ -1442,10 +1442,12 @@ esp_err_t esp_flash_suspend_cmd_init(esp_flash_t* chip)
|
||||
ESP_EARLY_LOGW(TAG, "Flash suspend feature is enabled");
|
||||
if (chip->chip_drv->get_chip_caps == NULL) {
|
||||
// chip caps get failed, pass the flash capability check.
|
||||
ESP_EARLY_LOGW(TAG, "get_chip_caps function pointer hasn't been initialized");
|
||||
ESP_EARLY_LOGE(TAG, "get_chip_caps function pointer hasn't been initialized");
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
} else {
|
||||
if ((chip->chip_drv->get_chip_caps(chip) & SPI_FLASH_CHIP_CAP_SUSPEND) == 0) {
|
||||
ESP_EARLY_LOGW(TAG, "Suspend and resume may not supported for this flash model yet.");
|
||||
ESP_EARLY_LOGE(TAG, "Suspend and resume may not supported for this flash model yet.");
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
return chip->chip_drv->sus_setup(chip);
|
||||
|
Reference in New Issue
Block a user