Avoid calling flashIsReady when flash chip is non-existent

Ideally, the flashfs driver should keep track of information regarding
underlying flash chip device, but it is nearly stateless.
This commit is contained in:
jflyper 2018-11-12 12:32:46 +09:00
parent 91c4a496a7
commit 715e54cf3c
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,9 @@ void flashfsEraseRange(uint32_t start, uint32_t end)
*/
bool flashfsIsReady(void)
{
return flashIsReady();
// Check for flash chip existence first, then check if ready.
return (flashfsIsSupported() && flashIsReady());
}
bool flashfsIsSupported(void)