mtd: introduce mtd_block_isbad 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
ead995f8d4
commit
7086c19d07
@@ -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 (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
|
||||
int (*suspend) (struct mtd_info *mtd);
|
||||
void (*resume) (struct mtd_info *mtd);
|
||||
|
||||
@@ -219,7 +220,6 @@ struct mtd_info {
|
||||
struct backing_dev_info *backing_dev_info;
|
||||
|
||||
/* Bad block management functions */
|
||||
int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
|
||||
int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
|
||||
|
||||
struct notifier_block reboot_notifier; /* default mode before reboot */
|
||||
@@ -406,6 +406,11 @@ static inline void mtd_resume(struct mtd_info *mtd)
|
||||
mtd->resume(mtd);
|
||||
}
|
||||
|
||||
static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs)
|
||||
{
|
||||
return mtd->block_isbad(mtd, ofs);
|
||||
}
|
||||
|
||||
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