mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
kernel/base-files: clean up old code related to refreshing mtd partitions, it is no longer used anywhere
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37282 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -44,10 +44,6 @@
|
||||
#include "fis.h"
|
||||
#include "mtd.h"
|
||||
|
||||
#ifndef MTDREFRESH
|
||||
#define MTDREFRESH _IO('M', 50)
|
||||
#endif
|
||||
|
||||
#define MAX_ARGS 8
|
||||
#define JFFS2_DEFAULT_DIR "" /* directory name without /, empty means root dir */
|
||||
|
||||
@@ -248,33 +244,6 @@ mtd_erase(const char *mtd)
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
mtd_refresh(const char *mtd)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (quiet < 2)
|
||||
fprintf(stderr, "Refreshing mtd partition %s ... ", mtd);
|
||||
|
||||
fd = mtd_check_open(mtd);
|
||||
if(fd < 0) {
|
||||
fprintf(stderr, "Could not open mtd device: %s\n", mtd);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ioctl(fd, MTDREFRESH, NULL)) {
|
||||
fprintf(stderr, "Failed to refresh the MTD device\n");
|
||||
close(fd);
|
||||
exit(1);
|
||||
}
|
||||
close(fd);
|
||||
|
||||
if (quiet < 2)
|
||||
fprintf(stderr, "\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
indicate_writing(const char *mtd)
|
||||
{
|
||||
@@ -575,7 +544,6 @@ int main (int argc, char **argv)
|
||||
CMD_ERASE,
|
||||
CMD_WRITE,
|
||||
CMD_UNLOCK,
|
||||
CMD_REFRESH,
|
||||
CMD_JFFS2WRITE,
|
||||
CMD_FIXTRX,
|
||||
CMD_FIXSEAMA,
|
||||
@@ -658,9 +626,6 @@ int main (int argc, char **argv)
|
||||
if ((strcmp(argv[0], "unlock") == 0) && (argc == 2)) {
|
||||
cmd = CMD_UNLOCK;
|
||||
device = argv[1];
|
||||
} else if ((strcmp(argv[0], "refresh") == 0) && (argc == 2)) {
|
||||
cmd = CMD_REFRESH;
|
||||
device = argv[1];
|
||||
} else if ((strcmp(argv[0], "erase") == 0) && (argc == 2)) {
|
||||
cmd = CMD_ERASE;
|
||||
device = argv[1];
|
||||
@@ -739,9 +704,6 @@ int main (int argc, char **argv)
|
||||
mtd_unlock(device);
|
||||
mtd_write_jffs2(device, imagefile, jffs2dir);
|
||||
break;
|
||||
case CMD_REFRESH:
|
||||
mtd_refresh(device);
|
||||
break;
|
||||
case CMD_FIXTRX:
|
||||
if (mtd_fixtrx) {
|
||||
mtd_fixtrx(device, offset);
|
||||
|
||||
Reference in New Issue
Block a user