ns16550: unify serial_keystone
[oweals/u-boot.git] / include / spi_flash.h
index 0ae0062d12f5efbd2bfc132e2061c2342254e9e2..f25b3e7819c641b6a7f1f6231d01b1fea95e35c8 100644 (file)
@@ -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)