diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 12:37:38 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:48 -0500 |
| commit | 5942ddbc500d1c9b75e571b656be97f65b26adfe (patch) | |
| tree | 7e96cfb905fb67bc40e1da30eb8454d674353a36 /include/linux/mtd | |
| parent | 7086c19d07429d697057587caf1e5e0345442d16 (diff) | |
mtd: introduce mtd_block_markbad 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 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index a307ad093a54..64aa54fba2df 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -211,6 +211,7 @@ struct mtd_info { | |||
| 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 (*block_isbad) (struct mtd_info *mtd, loff_t ofs); | 213 | int (*block_isbad) (struct mtd_info *mtd, loff_t ofs); |
| 214 | int (*block_markbad) (struct mtd_info *mtd, loff_t ofs); | ||
| 214 | int (*suspend) (struct mtd_info *mtd); | 215 | int (*suspend) (struct mtd_info *mtd); |
| 215 | void (*resume) (struct mtd_info *mtd); | 216 | void (*resume) (struct mtd_info *mtd); |
| 216 | 217 | ||
| @@ -219,9 +220,6 @@ struct mtd_info { | |||
| 219 | */ | 220 | */ |
| 220 | struct backing_dev_info *backing_dev_info; | 221 | struct backing_dev_info *backing_dev_info; |
| 221 | 222 | ||
| 222 | /* Bad block management functions */ | ||
| 223 | int (*block_markbad) (struct mtd_info *mtd, loff_t ofs); | ||
| 224 | |||
| 225 | struct notifier_block reboot_notifier; /* default mode before reboot */ | 223 | struct notifier_block reboot_notifier; /* default mode before reboot */ |
| 226 | 224 | ||
| 227 | /* ECC status information */ | 225 | /* ECC status information */ |
| @@ -411,6 +409,11 @@ static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs) | |||
| 411 | return mtd->block_isbad(mtd, ofs); | 409 | return mtd->block_isbad(mtd, ofs); |
| 412 | } | 410 | } |
| 413 | 411 | ||
| 412 | static inline int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs) | ||
| 413 | { | ||
| 414 | return mtd->block_markbad(mtd, ofs); | ||
| 415 | } | ||
| 416 | |||
| 414 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 417 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 415 | { | 418 | { |
| 416 | return dev ? dev_get_drvdata(dev) : NULL; | 419 | return dev ? dev_get_drvdata(dev) : NULL; |
