From: Akinobu Mita Date: Thu, 15 Aug 2013 13:55:07 +0000 (+0900) Subject: mtd: tests: return -EIO when mtdtest_read() failed to read requested bytes X-Git-Tag: next-20130822~69^2~29 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d9013e7109e04368dad4df4ce16f709c35600723;p=karo-tx-linux.git 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 --- 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; }