From d9013e7109e04368dad4df4ce16f709c35600723 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Thu, 15 Aug 2013 22:55:07 +0900 Subject: [PATCH] mtd: tests: return -EIO when mtdtest_read() failed to read requested bytes mtdtest_read() returns -EINVAL if the number of bytes actually read is smaller than the number of bytes requested. But mtdtest_write() returns -EIO in the similar error condition and returning -EIO seems more appropriate than -EINVAL in this case. Signed-off-by: Akinobu Mita Signed-off-by: Artem Bityutskiy --- drivers/mtd/tests/mtd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/tests/mtd_test.c b/drivers/mtd/tests/mtd_test.c index 9e6389647433..bda8c4de3433 100644 --- a/drivers/mtd/tests/mtd_test.c +++ b/drivers/mtd/tests/mtd_test.c @@ -91,7 +91,7 @@ int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf) if (mtd_is_bitflip(err)) err = 0; if (!err && read != size) - err = -EINVAL; + err = -EIO; return err; } -- 2.39.5