summaryrefslogtreecommitdiffstats
path: root/include/spi_flash.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/spi_flash.h')
-rw-r--r--include/spi_flash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 0ae0062d12..f25b3e7819 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -237,7 +237,7 @@ static inline int spi_flash_erase(struct spi_flash *flash, u32 offset,
static inline int spi_flash_protect(struct spi_flash *flash, u32 ofs, u32 len,
bool prot)
{
- if (!flash->flash_lock)
+ if (!flash->flash_lock || !flash->flash_unlock)
return -EOPNOTSUPP;
if (prot)
OpenPOWER on IntegriCloud