- if (((fd = open("/dev/mtd/1", O_RDWR)) < 0)
- || (ioctl(fd, MEMGETINFO, &mtdInfo))) {
- fprintf(stderr, "Could not get MTD device info from %s\n", FILENAME);
+ close(fd);
+
+ if ((fd = open("/dev/mtd/1", O_RDWR)) < 0) {
+ fd = open("/dev/mtd1", O_RDWR);
+ }
+
+ if (ioctl(fd, MEMGETINFO, &mtdInfo)) {
+ fprintf(stderr, "Could not get MTD device info from mtd\n");