mtd: introduce mtd_suspend interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
committed by
David Woodhouse
parent
e95e978645
commit
3fe4bae884
@@ -210,6 +210,7 @@ struct mtd_info {
|
||||
int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
|
||||
int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
|
||||
int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
|
||||
int (*suspend) (struct mtd_info *mtd);
|
||||
|
||||
/* Backing device capabilities for this device
|
||||
* - provides mmap capabilities
|
||||
@@ -217,7 +218,6 @@ struct mtd_info {
|
||||
struct backing_dev_info *backing_dev_info;
|
||||
|
||||
/* Power Management functions */
|
||||
int (*suspend) (struct mtd_info *mtd);
|
||||
void (*resume) (struct mtd_info *mtd);
|
||||
|
||||
/* Bad block management functions */
|
||||
@@ -398,6 +398,11 @@ static inline int mtd_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
|
||||
return mtd->is_locked(mtd, ofs, len);
|
||||
}
|
||||
|
||||
static inline int mtd_suspend(struct mtd_info *mtd)
|
||||
{
|
||||
return mtd->suspend(mtd);
|
||||
}
|
||||
|
||||
static inline struct mtd_info *dev_to_mtd(struct device *dev)
|
||||
{
|
||||
return dev ? dev_get_drvdata(dev) : NULL;
|
||||
|
Reference in New Issue
Block a user