diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-06-27 11:27:25 -0700 |
---|---|---|
committer | Artem Bityutskiy <dedekind1@gmail.com> | 2011-06-29 08:42:41 +0300 |
commit | 443188385cc3aa9d059012df6380ce6bbfed1393 (patch) | |
tree | 9ada8583f11935d1c74c8d6ddfdcf02f07465356 /flash_info.c | |
parent | 4d1793e25fd6691f8a2407d6d2dfb23809086ef0 (diff) |
mtd-utils: kill flash_info
According to "feature-removal-schedule," we kill flash_info in favor of
mtdinfo.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'flash_info.c')
-rw-r--r-- | flash_info.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/flash_info.c b/flash_info.c deleted file mode 100644 index d9a4492..0000000 --- a/flash_info.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * flash_info.c -- print info about a MTD device - */ - -#define PROGRAM_NAME "flash_info" - -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <fcntl.h> -#include <time.h> -#include <sys/ioctl.h> -#include <sys/mount.h> - -#include "common.h" -#include <mtd/mtd-user.h> - -static void usage(int status) -{ - fprintf(status ? stderr : stdout, - "Usage: %s <device> [devices]\n", - PROGRAM_NAME); - exit(status); -} - -int main(int argc, char *argv[]) -{ - int fd, i, regcount; - - warnmsg("this utility is deprecated in favor of `mtdinfo` and will be removed in mtd-utils-1.4.6"); - - if (argc < 2) - usage(1); - if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) - usage(0); - - for (i = 1; i < argc; ++i) { - const char *dev = argv[i]; - int r; - region_info_t reginfo; - - /* Open and size the device */ - fd = open(dev, O_RDONLY); - if (fd < 0) { - sys_errmsg("could not open: %s", dev); - continue; - } - - if (ioctl(fd, MEMGETREGIONCOUNT, ®count)) - continue; - - printf("%s: %d erase regions\n", dev, regcount); - for (r = 0; r < regcount; ++r) { - reginfo.regionindex = r; - if (ioctl(fd, MEMGETREGIONINFO, ®info) == 0) { - printf("Region %d is at 0x%x with size 0x%x and " - "has 0x%x blocks\n", r, reginfo.offset, - reginfo.erasesize, reginfo.numblocks); - } else { - warnmsg("can not read region %d from a %d region device", - r, regcount); - } - } - } - - return 0; -} |