aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-23 12:18:22 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:25:40 -0500
commitb66005cd3e6f104e0a1b6492110c337269b53ec3 (patch)
tree248a5f72af42c122072183a5e3a411b97a36e3c4 /include
parent7799f9ac8d8ff2db14736950275249df442baeac (diff)
mtd: introduce mtd_unlock interface
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.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 167bac2e380e..f30c35886f7c 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -208,13 +208,13 @@ struct mtd_info {
208 unsigned long count, loff_t to, size_t *retlen); 208 unsigned long count, loff_t to, size_t *retlen);
209 void (*sync) (struct mtd_info *mtd); 209 void (*sync) (struct mtd_info *mtd);
210 int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 210 int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
211 int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
211 212
212 /* Backing device capabilities for this device 213 /* Backing device capabilities for this device
213 * - provides mmap capabilities 214 * - provides mmap capabilities
214 */ 215 */
215 struct backing_dev_info *backing_dev_info; 216 struct backing_dev_info *backing_dev_info;
216 217
217 int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
218 int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); 218 int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
219 219
220 /* Power Management functions */ 220 /* Power Management functions */
@@ -389,6 +389,11 @@ static inline int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
389 return mtd->lock(mtd, ofs, len); 389 return mtd->lock(mtd, ofs, len);
390} 390}
391 391
392static inline int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
393{
394 return mtd->unlock(mtd, ofs, len);
395}
396
392static inline struct mtd_info *dev_to_mtd(struct device *dev) 397static inline struct mtd_info *dev_to_mtd(struct device *dev)
393{ 398{
394 return dev ? dev_get_drvdata(dev) : NULL; 399 return dev ? dev_get_drvdata(dev) : NULL;