diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 12:25:16 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:45 -0500 |
| commit | 3fe4bae88460869a8e553397cd9057a4ee7ca341 (patch) | |
| tree | 0158f2cf5abe127cc74d9b63a2c739797de64552 /include/linux/mtd | |
| parent | e95e9786455c11c8eac30d76e5289d4e40187f9a (diff) | |
mtd: introduce mtd_suspend interface
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 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 8b9901986c86..8e01bad44e25 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -210,6 +210,7 @@ struct mtd_info { | |||
| 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 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 212 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 212 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 213 | int (*suspend) (struct mtd_info *mtd); | ||
| 213 | 214 | ||
| 214 | /* Backing device capabilities for this device | 215 | /* Backing device capabilities for this device |
| 215 | * - provides mmap capabilities | 216 | * - provides mmap capabilities |
| @@ -217,7 +218,6 @@ struct mtd_info { | |||
| 217 | struct backing_dev_info *backing_dev_info; | 218 | struct backing_dev_info *backing_dev_info; |
| 218 | 219 | ||
| 219 | /* Power Management functions */ | 220 | /* Power Management functions */ |
| 220 | int (*suspend) (struct mtd_info *mtd); | ||
| 221 | void (*resume) (struct mtd_info *mtd); | 221 | void (*resume) (struct mtd_info *mtd); |
| 222 | 222 | ||
| 223 | /* Bad block management functions */ | 223 | /* Bad block management functions */ |
| @@ -398,6 +398,11 @@ static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) | |||
| 398 | return mtd->is_locked(mtd, ofs, len); | 398 | return mtd->is_locked(mtd, ofs, len); |
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | static inline int mtd_suspend(struct mtd_info *mtd) | ||
| 402 | { | ||
| 403 | return mtd->suspend(mtd); | ||
| 404 | } | ||
| 405 | |||
| 401 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 406 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 402 | { | 407 | { |
| 403 | return dev ? dev_get_drvdata(dev) : NULL; | 408 | return dev ? dev_get_drvdata(dev) : NULL; |
