aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-02-03 11:13:23 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:29:11 -0400
commit664addc248d2fed68d013d26ff2fc796d7134259 (patch)
tree197681f173c14068a8d634c9ab1c889fd02316cf /include/linux/mtd
parent5def48982b778aaebe201f85af7170b7d0a6619f (diff)
mtd: remove R/O checking duplication
Many drivers check whether the partition is R/O and return -EROFS if yes. Let's stop having duplicated checks and move them to the API functions instead. And again a bit of noise - deleted few too sparse newlines, sorry. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd')
-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 317a80c4d54c..fa20a8f0463a 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -268,6 +268,8 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
268 ops->retlen = ops->oobretlen = 0; 268 ops->retlen = ops->oobretlen = 0;
269 if (!mtd->_write_oob) 269 if (!mtd->_write_oob)
270 return -EOPNOTSUPP; 270 return -EOPNOTSUPP;
271 if (!(mtd->flags & MTD_WRITEABLE))
272 return -EROFS;
271 return mtd->_write_oob(mtd, to, ops); 273 return mtd->_write_oob(mtd, to, ops);
272} 274}
273 275