make gpio conformant to generic gpio spec.
[openwrt.git] / target / linux / ar7 / files / drivers / mtd / ar7part.c
index 8bfd571..3d160d4 100644 (file)
 #define AR7_PARTS      4
 #define ROOT_OFFSET    0xe0000
 
 #define AR7_PARTS      4
 #define ROOT_OFFSET    0xe0000
 
-#ifdef CONFIG_CPU_LITTLE_ENDIAN
-#define LOADER_MAGIC1  0xfeedfa42
-#define LOADER_MAGIC2  0xfeed1281
-#else
-#define LOADER_MAGIC1  0x42faedfe
-#define LOADER_MAGIC2  0x8112edfe
-#endif
+#define LOADER_MAGIC1  le32_to_cpu(0xfeedfa42)
+#define LOADER_MAGIC2  le32_to_cpu(0xfeed1281)
 
 struct ar7_bin_rec {
        unsigned int checksum;
 
 struct ar7_bin_rec {
        unsigned int checksum;
@@ -71,7 +66,7 @@ static int create_mtd_partitions(struct mtd_info *master,
        do { /* Try 10 blocks starting from master->erasesize */
                offset = pre_size;
                master->read(master, offset,
        do { /* Try 10 blocks starting from master->erasesize */
                offset = pre_size;
                master->read(master, offset,
-                       sizeof(header), &len, (u_char *)&header);
+                       sizeof(header), &len, (u8 *)&header);
                if (!strncmp((char *)&header, "TIENV0.8", 8))
                        ar7_parts[1].offset = pre_size;
                if (header.checksum == LOADER_MAGIC1)
                if (!strncmp((char *)&header, "TIENV0.8", 8))
                        ar7_parts[1].offset = pre_size;
                if (header.checksum == LOADER_MAGIC1)
@@ -93,7 +88,7 @@ static int create_mtd_partitions(struct mtd_info *master,
                while (header.length) {
                        offset += sizeof(header) + header.length;
                        master->read(master, offset, sizeof(header),
                while (header.length) {
                        offset += sizeof(header) + header.length;
                        master->read(master, offset, sizeof(header),
-                                    &len, (u_char *)&header);
+                                    &len, (u8 *)&header);
                }
                root_offset = offset + sizeof(header) + 4;
                break;
                }
                root_offset = offset + sizeof(header) + 4;
                break;
@@ -101,7 +96,7 @@ static int create_mtd_partitions(struct mtd_info *master,
                while (header.length) {
                        offset += sizeof(header) + header.length;
                        master->read(master, offset, sizeof(header),
                while (header.length) {
                        offset += sizeof(header) + header.length;
                        master->read(master, offset, sizeof(header),
-                                    &len, (u_char *)&header);
+                                    &len, (u8 *)&header);
                }
                root_offset = offset + sizeof(header) + 4 + 0xff;
                root_offset &= ~(u32)0xff;
                }
                root_offset = offset + sizeof(header) + 4 + 0xff;
                root_offset &= ~(u32)0xff;
@@ -112,7 +107,7 @@ static int create_mtd_partitions(struct mtd_info *master,
        }
 
        master->read(master, root_offset,
        }
 
        master->read(master, root_offset,
-               sizeof(header), &len, (u_char *)&header);
+               sizeof(header), &len, (u8 *)&header);
        if (header.checksum != SQUASHFS_MAGIC) {
                root_offset += master->erasesize - 1;
                root_offset &= ~(master->erasesize - 1);
        if (header.checksum != SQUASHFS_MAGIC) {
                root_offset += master->erasesize - 1;
                root_offset &= ~(master->erasesize - 1);
This page took 0.023239 seconds and 4 git commands to generate.