diff mbox series

Do not raise ERROR if MTD is not present

Message ID 20200405094443.10201-1-sbabic@denx.de
State Accepted
Headers show
Series Do not raise ERROR if MTD is not present | expand

Commit Message

Stefano Babic April 5, 2020, 9:44 a.m. UTC
If MTD is not present on device, raise a WARN instead of an error. MTD
could be ininfluent or an update, and if it is required, a runtime error
will be raised when it tries to access.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 corelib/mtd-interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/corelib/mtd-interface.c b/corelib/mtd-interface.c
index 9a193d9..bdc109b 100644
--- a/corelib/mtd-interface.c
+++ b/corelib/mtd-interface.c
@@ -141,8 +141,8 @@  void mtd_init(void)
 	flash->libmtd = libmtd_open();
 	if (flash->libmtd == NULL) {
 		if (errno == 0)
-			ERROR("MTD is not present in the system");
-		ERROR("cannot open libmtd");
+			WARN("MTD is not present in the system");
+		WARN("cannot open libmtd");
 	}
 }
 
@@ -388,7 +388,7 @@  int scan_mtd_devices (void)
 	bool black;
 
 	if (!libmtd) {
-		ERROR("MTD is not present on the target");
+		WARN("MTD is not present on the target");
 		return -1;
 	}
 	err = mtd_get_info(libmtd, mtd_info);