[PATCH 1/8] mtd: mtdraw: Simplify error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We do not need a printf when writing fails, it's the callers job
to report this. Remove printf and simplify the error path a bit.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/mtd/mtdraw.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c
index 4f7c3b836c..d0dde0dee2 100644
--- a/drivers/mtd/mtdraw.c
+++ b/drivers/mtd/mtdraw.c
@@ -146,11 +146,11 @@ static ssize_t mtdraw_read(struct cdev *cdev, void *buf, size_t count,
 		count -= ret;
 		retlen += ret;
 	}
+
 	if (ret < 0)
-		printf("err %zd\n", ret);
-	else
-		ret = retlen;
-	return ret;
+		return ret;
+
+	return retlen;
 }
 
 #ifdef CONFIG_MTD_WRITE
@@ -231,12 +231,10 @@ static ssize_t mtdraw_write(struct cdev *cdev, const void *buf, size_t count,
 		retlen += count;
 	}
 
-	if (ret < 0) {
-		printf("err %d\n", ret);
+	if (ret < 0)
 		return ret;
-	} else {
-		return retlen;
-	}
+
+	return retlen;
 }
 
 static int mtdraw_erase(struct cdev *cdev, loff_t count, loff_t offset)
-- 
2.19.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux