mtd: add missing <endian.h> include
[openwrt-working-2016/.git] / package / system / mtd / src / trx.c
index 65c24404c2c1fe771acf0f78936b7bbe187a944c..245ee7630ae26aee54e286fd719cda6ecb53b6b0 100644 (file)
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
+#include <endian.h>
 #include <string.h>
 #include <errno.h>
 
@@ -101,13 +102,14 @@ err:
        return -1;
 }
 
+#ifndef target_ar71xx
 int
 trx_check(int imagefd, const char *mtd, char *buf, int *len)
 {
        const struct trx_header *trx = (const struct trx_header *) buf;
        int fd;
 
-       if (strcmp(mtd, "linux") != 0)
+       if (strcmp(mtd, "firmware") != 0)
                return 1;
 
        *len = read(imagefd, buf, 32);
@@ -141,6 +143,7 @@ trx_check(int imagefd, const char *mtd, char *buf, int *len)
        close(fd);
        return 1;
 }
+#endif
 
 int
 mtd_fixtrx(const char *mtd, size_t offset)