From f45bc6e3c99b62d04d50f210ed8d4f8d02b15357 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 25 Aug 2016 13:41:50 +0200 Subject: Remove unused and broken mtd_write_img function from libmtd The function _tries_ to support short reads but doesn't adjust the pointer into the buffer. If a short read happens, we scrambles the flash contents. Interrupted reads aren't handled. Short or interrupted writes aren't handled at all. Either a write succeeds writing the entire buffer or the function gives up. During an attempt at fixing it, it was discovered, that no mtd-utils program uses this function. Furthermore, its highly specific nature makes it more of a "feature looking for use case". Signed-off-by: David Oberhollenzer Signed-off-by: Richard Weinberger --- include/libmtd.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'include/libmtd.h') diff --git a/include/libmtd.h b/include/libmtd.h index a78c8cb..a6ff050 100644 --- a/include/libmtd.h +++ b/include/libmtd.h @@ -319,21 +319,6 @@ int mtd_read_oob(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int mtd_write_oob(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, uint64_t start, uint64_t length, void *data); -/** - * mtd_write_img - write a file to MTD device. - * @mtd: MTD device description object - * @fd: MTD device node file descriptor - * @eb: eraseblock to write to - * @offs: offset withing the eraseblock to write to - * @img_name: the file to write - * - * This function writes an image @img_name the MTD device defined by @mtd. @eb - * and @offs are the starting eraseblock and offset on the MTD device. Returns - * %0 in case of success and %-1 in case of failure. - */ -int mtd_write_img(const struct mtd_dev_info *mtd, int fd, int eb, int offs, - const char *img_name); - /** * mtd_probe_node - test MTD node. * @desc: MTD library descriptor -- cgit v1.2.3