diff options
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r-- | include/linux/mtd/mtd.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 089370758fc..7e35755f693 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -440,6 +440,8 @@ static inline void mtd_resume(struct mtd_info *mtd) static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) { + if (!mtd->block_isbad) + return -EOPNOTSUPP; return mtd->block_isbad(mtd, ofs); } @@ -483,6 +485,11 @@ static inline int mtd_has_oob(const struct mtd_info *mtd) return mtd->read_oob && mtd->write_oob; } +static inline int mtd_can_have_bb(const struct mtd_info *mtd) +{ + return !!mtd->block_isbad; +} + /* Kernel-side ioctl definitions */ struct mtd_partition; |