]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/mtd/mtd.h
mtd: introduce mtd_erase interface
[mirror_ubuntu-artful-kernel.git] / include / linux / mtd / mtd.h
index 9f5b312af7838d5275ff9611030da3861ec2d612..201bad5570478e8de1f3ee26cc24b80dcef0e912 100644 (file)
@@ -171,11 +171,8 @@ struct mtd_info {
        struct mtd_erase_region_info *eraseregions;
 
        /*
-        * Erase is an asynchronous operation.  Device drivers are supposed
-        * to call instr->callback() whenever the operation completes, even
-        * if it completes with a failure.
-        * Callers are supposed to pass a callback function and wait for it
-        * to be called before writing to the block.
+        * Do not call via these pointers, use corresponding mtd_*()
+        * wrappers instead.
         */
        int (*erase) (struct mtd_info *mtd, struct erase_info *instr);
 
@@ -274,6 +271,18 @@ struct mtd_info {
        void (*put_device) (struct mtd_info *mtd);
 };
 
+/*
+ * Erase is an asynchronous operation.  Device drivers are supposed
+ * to call instr->callback() whenever the operation completes, even
+ * if it completes with a failure.
+ * Callers are supposed to pass a callback function and wait for it
+ * to be called before writing to the block.
+ */
+static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
+{
+       return mtd->erase(mtd, instr);
+}
+
 static inline struct mtd_info *dev_to_mtd(struct device *dev)
 {
        return dev ? dev_get_drvdata(dev) : NULL;