OpenWrt – Diff between revs 2 and 3

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 2 Rev 3
Line 17... Line 17...
17 +#define MTD_ERASE_PARTIAL 0x8000 /* partition only covers parts of an erase block */ 17 +#define MTD_ERASE_PARTIAL 0x8000 /* partition only covers parts of an erase block */
18 + 18 +
19 /* Our partition linked list */ 19 /* Our partition linked list */
20 static LIST_HEAD(mtd_partitions); 20 static LIST_HEAD(mtd_partitions);
21 static DEFINE_MUTEX(mtd_partitions_mutex); 21 static DEFINE_MUTEX(mtd_partitions_mutex);
22 @@ -255,13 +257,61 @@ static int part_erase(struct mtd_info *m 22 @@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m
23 struct mtd_part *part = mtd_to_part(mtd); 23 struct mtd_part *part = mtd_to_part(mtd);
24 int ret; 24 int ret;
Line 25... Line 25...
25 25
26 + 26 +
Line 79... Line 79...
79 } 79 }
80 + 80 +
81 return ret; 81 return ret;
82 } 82 }
Line 83... Line 83...
83 83
84 @@ -269,6 +319,25 @@ void mtd_erase_callback(struct erase_inf 84 @@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf
85 { 85 {
86 if (instr->mtd->_erase == part_erase) { 86 if (instr->mtd->_erase == part_erase) {
87 struct mtd_part *part = mtd_to_part(instr->mtd); 87 struct mtd_part *part = mtd_to_part(instr->mtd);
88 + size_t wrlen = 0; 88 + size_t wrlen = 0;
Line 105... Line 105...
105 + kfree(instr->erase_buf); 105 + kfree(instr->erase_buf);
106 + } 106 + }
Line 107... Line 107...
107 107
108 if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) 108 if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN)
109 instr->fail_addr -= part->offset; 109 instr->fail_addr -= part->offset;
110 @@ -584,19 +653,22 @@ static struct mtd_part *allocate_partiti 110 @@ -570,19 +639,22 @@ static struct mtd_part *allocate_partiti
111 remainder = do_div(tmp, wr_alignment); 111 remainder = do_div(tmp, wr_alignment);
112 if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { 112 if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
113 /* Doesn't start on a boundary of major erase size */ 113 /* Doesn't start on a boundary of major erase size */
114 - /* FIXME: Let it be writable if it is on a boundary of 114 - /* FIXME: Let it be writable if it is on a boundary of
Line 121... Line 121...
121 + slave->mtd.flags &= ~MTD_WRITEABLE; 121 + slave->mtd.flags &= ~MTD_WRITEABLE;
122 + else 122 + else
123 + slave->mtd.erasesize = slave->mtd.size; 123 + slave->mtd.erasesize = slave->mtd.size;
124 } 124 }
Line 125... Line 125...
125 125
126 - tmp = part_absolute_offset(parent) + slave->mtd.size; 126 - tmp = slave->mtd.size;
127 + tmp = part_absolute_offset(parent) + slave->offset + slave->mtd.size; 127 + tmp = slave->offset + slave->mtd.size;
128 remainder = do_div(tmp, wr_alignment); 128 remainder = do_div(tmp, wr_alignment);
129 if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { 129 if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) {
130 - slave->mtd.flags &= ~MTD_WRITEABLE; 130 - slave->mtd.flags &= ~MTD_WRITEABLE;
131 - printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n", 131 - printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n",