tree 236d8fd4f1ce2ef32226689d254263c9c8d88219
parent 22fd9a8750bcad4999768aafc8fbd8a4bd6f5aa1
author Thomas Gleixner <[EMAIL PROTECTED]> Tue, 24 May 2005 20:50:18 +0200
committer Thomas Gleixner <[EMAIL PROTECTED]> Tue, 24 May 2005 20:50:18 +0200

[MTD] Make map_word_ff ware of the flash buswidth

map_word_ff() was setting the mapword to ~0UL regardless of the
buswidth of the mapped flash chip. The read_map functions are
buswidth aware and therefor the map_word_equal function failed.

Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 include/linux/mtd/map.h |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
 
 /* Overhauled routines for dealing with different mmap regions of flash */
-/* $Id: map.h,v 1.48 2005/02/16 15:54:59 nico Exp $ */
+/* $Id: map.h,v 1.49 2005/05/24 18:45:15 gleixner Exp $ */
 
 #ifndef __LINUX_MTD_MAP_H__
 #define __LINUX_MTD_MAP_H__
@@ -340,13 +340,22 @@ static inline map_word map_word_load_par
        return orig;
 }
 
+#if BITS_PER_LONG < 64
+#define MAP_FF_LIMIT 4
+#else
+#define MAP_FF_LIMIT 8
+#endif
+
 static inline map_word map_word_ff(struct map_info *map)
 {
        map_word r;
        int i;
-
-       for (i=0; i<map_words(map); i++) {
-               r.x[i] = ~0UL;
+       
+       if (map_bank_width(map) < MAP_FF_LIMIT) {
+               r.x[0] = (1 << (8*map_bank_width(map))) - 1;
+       } else {
+               for (i=0; i<map_words(map); i++)
+                       r.x[i] = ~0UL;
        }
        return r;
 }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to