public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] spi_flash: Add error message when lock operations are not supported
@ 2015-11-11 15:21 Fabio Estevam
  2015-11-11 15:21 ` [U-Boot] [PATCH 2/2] sf_probe: Add lock ops for SST SPI NOR flash Fabio Estevam
  2015-11-17 18:20 ` [U-Boot] [PATCH 1/2] spi_flash: Add error message when lock operations are not supported Jagan Teki
  0 siblings, 2 replies; 5+ messages in thread
From: Fabio Estevam @ 2015-11-11 15:21 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@freescale.com>

In the case of lock operations not being supported, we should better let
the user know instead of failing silently.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 include/spi_flash.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/spi_flash.h b/include/spi_flash.h
index 0ae0062..ff51c50 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -237,8 +237,10 @@ 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) {
+		printf("Protect operation not supported for this flash\n");
 		return -EOPNOTSUPP;
+	}
 
 	if (prot)
 		return flash->flash_lock(flash, ofs, len);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-17 18:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-11 15:21 [U-Boot] [PATCH 1/2] spi_flash: Add error message when lock operations are not supported Fabio Estevam
2015-11-11 15:21 ` [U-Boot] [PATCH 2/2] sf_probe: Add lock ops for SST SPI NOR flash Fabio Estevam
2015-11-17 11:21   ` Fabio Estevam
2015-11-17 18:22   ` Jagan Teki
2015-11-17 18:20 ` [U-Boot] [PATCH 1/2] spi_flash: Add error message when lock operations are not supported Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox