Use 2.6.25.6 for rdc
[openwrt.git] / target / linux / ar7 / patches-2.6.25 / 200-mtd_fixes.patch
1 Index: linux-2.6.25.4/drivers/mtd/ar7part.c
2 ===================================================================
3 --- linux-2.6.25.4.orig/drivers/mtd/ar7part.c
4 +++ linux-2.6.25.4/drivers/mtd/ar7part.c
5 @@ -34,6 +34,10 @@
6 #define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42)
7 #define LOADER_MAGIC2 le32_to_cpu(0xfeed1281)
8
9 +#ifndef SQUASHFS_MAGIC
10 +#define SQUASHFS_MAGIC 0x73717368
11 +#endif
12 +
13 struct ar7_bin_rec {
14 unsigned int checksum;
15 unsigned int length;
16 @@ -47,7 +51,8 @@ static int create_mtd_partitions(struct
17 unsigned long origin)
18 {
19 struct ar7_bin_rec header;
20 - unsigned int offset, len;
21 + unsigned int offset;
22 + size_t len;
23 unsigned int pre_size = master->erasesize, post_size = 0;
24 unsigned int root_offset = ROOT_OFFSET;
25
26 @@ -66,7 +71,7 @@ static int create_mtd_partitions(struct
27 do { /* Try 10 blocks starting from master->erasesize */
28 offset = pre_size;
29 master->read(master, offset,
30 - sizeof(header), &len, (u8 *)&header);
31 + sizeof(header), &len, (uint8_t *)&header);
32 if (!strncmp((char *)&header, "TIENV0.8", 8))
33 ar7_parts[1].offset = pre_size;
34 if (header.checksum == LOADER_MAGIC1)
35 @@ -88,7 +93,7 @@ static int create_mtd_partitions(struct
36 while (header.length) {
37 offset += sizeof(header) + header.length;
38 master->read(master, offset, sizeof(header),
39 - &len, (u8 *)&header);
40 + &len, (uint8_t *)&header);
41 }
42 root_offset = offset + sizeof(header) + 4;
43 break;
44 @@ -96,10 +101,10 @@ static int create_mtd_partitions(struct
45 while (header.length) {
46 offset += sizeof(header) + header.length;
47 master->read(master, offset, sizeof(header),
48 - &len, (u8 *)&header);
49 + &len, (uint8_t *)&header);
50 }
51 root_offset = offset + sizeof(header) + 4 + 0xff;
52 - root_offset &= ~(u32)0xff;
53 + root_offset &= ~(uint32_t)0xff;
54 break;
55 default:
56 printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);
This page took 0.044661 seconds and 5 git commands to generate.