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

login
register
mail settings
Submitter Richard Weinberger
Date June 1, 2012, 3:16 p.m.
Message ID <1338563804-85990-22-git-send-email-richard@nod.at>
Download mbox | patch
Permalink /patch/162345/
State New
Headers show

Comments

Richard Weinberger - June 1, 2012, 3:16 p.m.
Print the message in ubi_scan_fastmap().

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

Patch

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;
 }