]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mtd: tests: return -EIO when mtdtest_read() failed to read requested bytes
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 15 Aug 2013 13:55:07 +0000 (22:55 +0900)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 16 Aug 2013 13:41:30 +0000 (16:41 +0300)
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 <akinobu.mita@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/tests/mtd_test.c

index 9e6389647433613e40f4a3c0e983d763962fc4ea..bda8c4de3433826dd9c6f934c59d5b28ec84eb29 100644 (file)
@@ -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;
 }