aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-30 08:57:25 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:05 -0500
commit52b020317f65114eeba2ee2cfa70a51a286f1d8a (patch)
treea7b071413221fef69cc8b2c2a55cb1a6ba305298 /include
parent4ccf2f1349e681401b5fae73efc87b8d2d70ce0e (diff)
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 <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/mtd.h2
1 files changed, 2 insertions, 0 deletions
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,
291 size_t *retlen, const u_char *buf) 291 size_t *retlen, const u_char *buf)
292{ 292{
293 *retlen = 0; 293 *retlen = 0;
294 if (!mtd->write)
295 return -EROFS;
294 return mtd->write(mtd, to, len, retlen, buf); 296 return mtd->write(mtd, to, len, retlen, buf);
295} 297}
296 298