summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-04-26 00:13:23 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2016-11-17 11:36:55 +0100
commit5d524111adc549ec80e577dd3d9045a4c589fa7b (patch)
tree413e9b4560af154d29589f335a96a35304015977 /include
parent3516b8b7558a69dfd06410b0c997d096a78221c9 (diff)
mtd-utils: Add multi-block erase function
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'include')
-rw-r--r--include/libmtd.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/libmtd.h b/include/libmtd.h
index a6ff050..f9f3164 100644
--- a/include/libmtd.h
+++ b/include/libmtd.h
@@ -174,6 +174,20 @@ int mtd_lock(const struct mtd_dev_info *mtd, int fd, int eb);
int mtd_unlock(const struct mtd_dev_info *mtd, int fd, int eb);
/**
+ * mtd_erase - erase multiple eraseblocks.
+ * @desc: MTD library descriptor
+ * @mtd: MTD device description object
+ * @fd: MTD device node file descriptor
+ * @eb: index of first eraseblock to erase
+ * @blocks: the number of eraseblocks to erase
+ *
+ * This function erases @blocks starting at eraseblock @eb of MTD device
+ * described by @fd. Returns %0 in case of success and %-1 in case of failure.
+ */
+int mtd_erase_multi(libmtd_t desc, const struct mtd_dev_info *mtd,
+ int fd, int eb, int blocks);
+
+/**
* mtd_erase - erase an eraseblock.
* @desc: MTD library descriptor
* @mtd: MTD device description object