From 52b020317f65114eeba2ee2cfa70a51a286f1d8a Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 30 Dec 2011 15:57:25 +0200 Subject: mtd: clean-up the default_mtd_writev function 1. Teach 'mtd_write()' function to return '-EROFS' if the write method is undefined, and remove the corresponding check from 'default_mtd_writev()'. 2. Do not test 'retlen' for NULL - it cannot be NULL. 3. Few minor coding stile clean-ups. 4. Add a kerneldoc comment Additionally, minor fixes to the kerneldoc comments of the neighbor function. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- include/linux/mtd/mtd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/mtd/mtd.h') diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 671c89289fc3..f0dd5a305b89 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -291,6 +291,8 @@ static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { *retlen = 0; + if (!mtd->write) + return -EROFS; return mtd->write(mtd, to, len, retlen, buf); } -- cgit v1.2.3