aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/redboot.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2006-03-02 05:54:29 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-02 11:33:07 -0500
commit77a3313551afd53c90012e5a87f7f2b2195fc67e (patch)
tree996a210b97311a1af71c9c9faa71eeb8e4c69c00 /drivers/mtd/redboot.c
parent140ffcec4def3ee3af7565b2cf1d3b2580f7e180 (diff)
[PATCH] "drivers/mtd/redboot.c: recognise a foreign byte sex partition table" update
Sync up the recent redboot fix with MTD CVS. It uses the correct swab() functions. Cc: John Bowler <jbowler@acm.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mtd/redboot.c')
-rw-r--r--drivers/mtd/redboot.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c
index d01b6a9198e0..8815c8dbef2d 100644
--- a/drivers/mtd/redboot.c
+++ b/drivers/mtd/redboot.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: redboot.c,v 1.18 2005/11/07 11:14:21 gleixner Exp $ 2 * $Id: redboot.c,v 1.19 2005/12/01 10:03:51 dwmw2 Exp $
3 * 3 *
4 * Parse RedBoot-style Flash Image System (FIS) tables and 4 * Parse RedBoot-style Flash Image System (FIS) tables and
5 * produce a Linux partition array to match. 5 * produce a Linux partition array to match.
@@ -92,10 +92,10 @@ static int parse_redboot_partitions(struct mtd_info *master,
92 if (!memcmp(buf[i].name, "FIS directory", 14)) { 92 if (!memcmp(buf[i].name, "FIS directory", 14)) {
93 /* This is apparently the FIS directory entry for the 93 /* This is apparently the FIS directory entry for the
94 * FIS directory itself. The FIS directory size is 94 * FIS directory itself. The FIS directory size is
95 * one erase block, if the buf[i].size field is 95 * one erase block; if the buf[i].size field is
96 * swab32(erasesize) then we know we are looking at 96 * swab32(erasesize) then we know we are looking at
97 * a byte swapped FIS directory - swap all the entries! 97 * a byte swapped FIS directory - swap all the entries!
98 * (NOTE: this is 'size' not 'data_length', size is 98 * (NOTE: this is 'size' not 'data_length'; size is
99 * the full size of the entry.) 99 * the full size of the entry.)
100 */ 100 */
101 if (swab32(buf[i].size) == master->erasesize) { 101 if (swab32(buf[i].size) == master->erasesize) {
@@ -104,15 +104,13 @@ static int parse_redboot_partitions(struct mtd_info *master,
104 /* The unsigned long fields were written with the 104 /* The unsigned long fields were written with the
105 * wrong byte sex, name and pad have no byte sex. 105 * wrong byte sex, name and pad have no byte sex.
106 */ 106 */
107# define do_swab32(x) (x) = swab32(x) 107 swab32s(&buf[j].flash_base);
108 do_swab32(buf[j].flash_base); 108 swab32s(&buf[j].mem_base);
109 do_swab32(buf[j].mem_base); 109 swab32s(&buf[j].size);
110 do_swab32(buf[j].size); 110 swab32s(&buf[j].entry_point);
111 do_swab32(buf[j].entry_point); 111 swab32s(&buf[j].data_length);
112 do_swab32(buf[j].data_length); 112 swab32s(&buf[j].desc_cksum);
113 do_swab32(buf[j].desc_cksum); 113 swab32s(&buf[j].file_cksum);
114 do_swab32(buf[j].file_cksum);
115# undef do_swab32
116 } 114 }
117 } 115 }
118 break; 116 break;