aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/mtd.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 9f5b312af78..201bad55704 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -171,11 +171,8 @@ struct mtd_info {
171 struct mtd_erase_region_info *eraseregions; 171 struct mtd_erase_region_info *eraseregions;
172 172
173 /* 173 /*
174 * Erase is an asynchronous operation. Device drivers are supposed 174 * Do not call via these pointers, use corresponding mtd_*()
175 * to call instr->callback() whenever the operation completes, even 175 * wrappers instead.
176 * if it completes with a failure.
177 * Callers are supposed to pass a callback function and wait for it
178 * to be called before writing to the block.
179 */ 176 */
180 int (*erase) (struct mtd_info *mtd, struct erase_info *instr); 177 int (*erase) (struct mtd_info *mtd, struct erase_info *instr);
181 178
@@ -274,6 +271,18 @@ struct mtd_info {
274 void (*put_device) (struct mtd_info *mtd); 271 void (*put_device) (struct mtd_info *mtd);
275}; 272};
276 273
274/*
275 * Erase is an asynchronous operation. Device drivers are supposed
276 * to call instr->callback() whenever the operation completes, even
277 * if it completes with a failure.
278 * Callers are supposed to pass a callback function and wait for it
279 * to be called before writing to the block.
280 */
281static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
282{
283 return mtd->erase(mtd, instr);
284}
285
277static inline struct mtd_info *dev_to_mtd(struct device *dev) 286static inline struct mtd_info *dev_to_mtd(struct device *dev)
278{ 287{
279 return dev ? dev_get_drvdata(dev) : NULL; 288 return dev ? dev_get_drvdata(dev) : NULL;