[PATCH 21/23] UBI: Fastmap: Fix error message

Richard Weinberger richard at nod.at
Fri Jun 1 11:16:42 EDT 2012


Print the message in ubi_scan_fastmap().

Signed-off-by: Richard Weinberger <richard at nod.at>
---
 drivers/mtd/ubi/attach.c  |   10 ----------
 drivers/mtd/ubi/fastmap.c |    3 +++
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 4d86621..44f3770 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1222,16 +1222,6 @@ int ubi_attach(struct ubi_device *ubi)
 
 	err = ubi_scan_fastmap(ubi, ai);
 	if (err > 0) {
-		/* TODO: in UBIFS we have a convention: every function prints
-		 * its own error messages. This makes things cleaner and easier
-		 * - the caller should not care about printing anything.
-		 * Please, move this error message to 'ubi_scan_fastmap()'. And
-		 * keep this in mind, and do similar thing globally for entire
-		 * fastmap code. */
-		if (err == UBI_BAD_FASTMAP)
-			ubi_err("Attach by fastmap failed! "
-				"Falling back to attach by scanning.");
-
 		err = scan_all(ubi, ai);
 		if (err)
 			return err;
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 78f196d..90bcaf0 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -936,6 +936,9 @@ free_hdr:
 free_raw:
 	vfree(fm_raw);
 out:
+	if (ret == UBI_BAD_FASTMAP)
+		ubi_err("Attach by fastmap failed, doing a full scan!");
+
 	return ret;
 }
 
-- 
1.7.6.5




More information about the linux-mtd mailing list