diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-30 10:00:35 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:26:22 -0500 |
| commit | 381345652fca688aeaa967c231e5075cf68d05b6 (patch) | |
| tree | 5f23ecdd28165d15109c6fd7ad0c4c573f094707 /include/linux/mtd | |
| parent | 327cf2922b4edf0439b219469722d2a502e37349 (diff) | |
mtd: do not use mtd->lock, unlock and is_locked directly
Instead, call the corresponding MTD API function which will return
'-EOPNOTSUPP' if the operation is not supported.
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.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 305f12b940f..6c91ba59c22 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -406,16 +406,22 @@ static inline void mtd_sync(struct mtd_info *mtd) | |||
| 406 | /* Chip-supported device locking */ | 406 | /* Chip-supported device locking */ |
| 407 | static inline int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | 407 | static inline int mtd_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
| 408 | { | 408 | { |
| 409 | if (!mtd->lock) | ||
| 410 | return -EOPNOTSUPP; | ||
| 409 | return mtd->lock(mtd, ofs, len); | 411 | return mtd->lock(mtd, ofs, len); |
| 410 | } | 412 | } |
| 411 | 413 | ||
| 412 | static inline int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) | 414 | static inline int mtd_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
| 413 | { | 415 | { |
| 416 | if (!mtd->unlock) | ||
| 417 | return -EOPNOTSUPP; | ||
| 414 | return mtd->unlock(mtd, ofs, len); | 418 | return mtd->unlock(mtd, ofs, len); |
| 415 | } | 419 | } |
| 416 | 420 | ||
| 417 | static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) | 421 | static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) |
| 418 | { | 422 | { |
| 423 | if (!mtd->is_locked) | ||
| 424 | return -EOPNOTSUPP; | ||
| 419 | return mtd->is_locked(mtd, ofs, len); | 425 | return mtd->is_locked(mtd, ofs, len); |
| 420 | } | 426 | } |
| 421 | 427 | ||
