aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-30 10:15:59 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:23 -0500
commit079c985e7a6f4ce60f931cebfdd5ee3c38347e31 (patch)
treeb4db3f6e38409eeaa8daff4c17b8f642d0939177 /include/linux/mtd
parent381345652fca688aeaa967c231e5075cf68d05b6 (diff)
mtd: do not use mtd->suspend and mtd->resume directly
Just call the 'mtd_suspend()' and 'mtd_resume()' - they will do nothing if the operation is not defined. 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.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 6c91ba59c229..089370758fc9 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -427,12 +427,15 @@ static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
427 427
428static inline int mtd_suspend(struct mtd_info *mtd) 428static inline int mtd_suspend(struct mtd_info *mtd)
429{ 429{
430 if (!mtd->suspend)
431 return -EOPNOTSUPP;
430 return mtd->suspend(mtd); 432 return mtd->suspend(mtd);
431} 433}
432 434
433static inline void mtd_resume(struct mtd_info *mtd) 435static inline void mtd_resume(struct mtd_info *mtd)
434{ 436{
435 mtd->resume(mtd); 437 if (mtd->resume)
438 mtd->resume(mtd);
436} 439}
437 440
438static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) 441static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs)