1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-14 06:45:21 +02:00
openwrt-xburst/target/linux/ar7/patches-2.6.26/200-mtd_fixes.patch
juhosg 0f80ce2088 [kernel] refresh 2.6.26 patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13135 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-11-06 20:55:33 +00:00

55 lines
1.7 KiB
Diff

--- a/drivers/mtd/ar7part.c
+++ b/drivers/mtd/ar7part.c
@@ -34,6 +34,10 @@
#define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42)
#define LOADER_MAGIC2 le32_to_cpu(0xfeed1281)
+#ifndef SQUASHFS_MAGIC
+#define SQUASHFS_MAGIC 0x73717368
+#endif
+
struct ar7_bin_rec {
unsigned int checksum;
unsigned int length;
@@ -47,7 +51,8 @@ static int create_mtd_partitions(struct
unsigned long origin)
{
struct ar7_bin_rec header;
- unsigned int offset, len;
+ unsigned int offset;
+ size_t len;
unsigned int pre_size = master->erasesize, post_size = 0;
unsigned int root_offset = ROOT_OFFSET;
@@ -66,7 +71,7 @@ static int create_mtd_partitions(struct
do { /* Try 10 blocks starting from master->erasesize */
offset = pre_size;
master->read(master, offset,
- sizeof(header), &len, (u8 *)&header);
+ sizeof(header), &len, (uint8_t *)&header);
if (!strncmp((char *)&header, "TIENV0.8", 8))
ar7_parts[1].offset = pre_size;
if (header.checksum == LOADER_MAGIC1)
@@ -88,7 +93,7 @@ static int create_mtd_partitions(struct
while (header.length) {
offset += sizeof(header) + header.length;
master->read(master, offset, sizeof(header),
- &len, (u8 *)&header);
+ &len, (uint8_t *)&header);
}
root_offset = offset + sizeof(header) + 4;
break;
@@ -96,10 +101,10 @@ static int create_mtd_partitions(struct
while (header.length) {
offset += sizeof(header) + header.length;
master->read(master, offset, sizeof(header),
- &len, (u8 *)&header);
+ &len, (uint8_t *)&header);
}
root_offset = offset + sizeof(header) + 4 + 0xff;
- root_offset &= ~(u32)0xff;
+ root_offset &= ~(uint32_t)0xff;
break;
default:
printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);