summaryrefslogtreecommitdiff
path: root/include/linux/mtd/mtd.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-23 21:35:30 +0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 22:25:47 +0400
commit7086c19d07429d697057587caf1e5e0345442d16 (patch)
tree3a892182dba0847de32ef79b1fe1d46d8b1b5de8 /include/linux/mtd/mtd.h
parentead995f8d4da1e2f1ef40b0e5f4133fee38a3d3d (diff)
downloadlinux-7086c19d07429d697057587caf1e5e0345442d16.tar.xz
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>
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r--include/linux/mtd/mtd.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index d6b4aa177505..a307ad093a54 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -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;