]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[MTD] Fix CFI build error when no map width or interleave supported
authorDavid Woodhouse <dwmw2@infradead.org>
Thu, 6 Sep 2007 08:40:21 +0000 (09:40 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Thu, 6 Sep 2007 08:40:21 +0000 (09:40 +0100)
When building NOR flash support, you have compile-time options for the
bus width and the number of individual chips which are interleaved
together onto that bus. The code to deal with arbitrary geometry is a
bit convoluted, and people want to just configure it for the specific
hardware they have, to avoid the runtime overhead.

Selecting _none_ of the available options doesn't make any sense. You
should have at least one. This makes it build though, since people
persist in trying.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
include/linux/mtd/cfi.h
include/linux/mtd/map.h

index 123948b1454787401b63aefebb2dec1278f99a3f..e17c5343cf517e6938c93551e6878400b6a11046 100644 (file)
 #define cfi_interleave_is_8(cfi) (0)
 #endif
 
+#ifndef cfi_interleave
+#warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work.
+static inline int cfi_interleave(void *cfi)
+{
+       BUG();
+       return 0;
+}
+#endif
+
 static inline int cfi_interleave_supported(int i)
 {
        switch (i) {
index 81f3a314dd76dfc6057ef9f7a82fff3b4d08c652..a9fae032ba8176db0a256aea1160f3c04e78720e 100644 (file)
 #endif
 
 #ifndef map_bankwidth
-#error "No bus width supported. What's the point?"
+#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
+static inline int map_bankwidth(void *map)
+{
+       BUG();
+       return 0;
+}
+#define map_bankwidth_is_large(map) (0)
+#define map_words(map) (0)
+#define MAX_MAP_BANKWIDTH 1
 #endif
 
 static inline int map_bankwidth_supported(int w)