]> www.infradead.org Git - mtd-utils.git/commitdiff
Remove unused legacy_libmtd_open internal libmtd function
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 25 Aug 2016 11:38:20 +0000 (13:38 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 17 Nov 2016 10:36:55 +0000 (11:36 +0100)
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
lib/libmtd_int.h
lib/libmtd_legacy.c

index 7913e676cd7e0c47ec5b05ead33fd7875d7fa084..8ff33ad6864a83b54335fdcbf0ea24fab809e894 100644 (file)
@@ -94,7 +94,6 @@ struct libmtd
        unsigned int offs64_ioctls:2;
 };
 
-int legacy_libmtd_open(void);
 int legacy_dev_present(int mtd_num);
 int legacy_mtd_get_info(struct mtd_info *info);
 int legacy_get_dev_info(const char *node, struct mtd_dev_info *mtd);
index 233a92ebaf6e750986105ad293398c1e4221b8a5..ba8eade402e1a87ea2e772fc7491199c2b78b249 100644 (file)
@@ -145,30 +145,6 @@ static int proc_parse_next(struct proc_parse_info *pi)
        return 1;
 }
 
-/**
- * legacy_libmtd_open - legacy version of 'libmtd_open()'.
- *
- * This function is just checks that MTD is present in the system. Returns
- * zero in case of success and %-1 in case of failure. In case of failure,
- * errno contains zero if MTD is not present in the system, or contains the
- * error code if a real error happened. This is similar to the 'libmtd_open()'
- * return conventions.
- */
-int legacy_libmtd_open(void)
-{
-       int fd;
-
-       fd = open(MTD_PROC_FILE, O_RDONLY);
-       if (fd == -1) {
-               if (errno == ENOENT)
-                       errno = 0;
-               return -1;
-       }
-
-       close(fd);
-       return 0;
-}
-
 /**
  * legacy_dev_presentl - legacy version of 'mtd_dev_present()'.
  * @info: the MTD device information is returned here