Skip to content

Commit

Permalink
[MTD] Fix CFI build error when no map width or interleave supported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Woodhouse committed Sep 6, 2007
1 parent d15057b commit 241651d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions include/linux/mtd/cfi.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
#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) {
Expand Down
10 changes: 9 additions & 1 deletion include/linux/mtd/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,15 @@
#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)
Expand Down

0 comments on commit 241651d

Please sign in to comment.