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>
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 671c892..f0dd5a30 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -291,6 +291,8 @@
size_t *retlen, const u_char *buf)
{
*retlen = 0;
+ if (!mtd->write)
+ return -EROFS;
return mtd->write(mtd, to, len, retlen, buf);
}