zorro: Do not allocate zorro_autocon[] statically

Currently the array of Zorro devices is allocated statically, wasting
up to 4.5 KiB when running an Amiga or multi-platform kernel on a machine
with no or a handful of Zorro expansion cards. Convert it to conditional
dynamic memory allocation to fix this.

amiga_parse_bootinfo() still needs to store some information about the
detected Zorro devices, at a time even the bootmem allocator is not yet
available.  This is now handled using a much smaller array (typically less
than 0.5 KiB), which is __initdata and thus freed later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
Geert Uytterhoeven
2013-06-29 10:40:20 +02:00
parent 1ea636eb68
commit c293738e6d
4 changed files with 38 additions and 9 deletions

View File

@@ -175,7 +175,23 @@ static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z)
extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */
extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO];
extern struct zorro_dev *zorro_autocon;
/*
* Minimal information about a Zorro device, passed from bootinfo
* Only available temporarily, i.e. until initmem has been freed!
*/
struct zorro_dev_init {
struct ExpansionRom rom;
u16 slotaddr;
u16 slotsize;
u32 boardaddr;
u32 boardsize;
};
extern struct zorro_dev_init zorro_autocon_init[ZORRO_NUM_AUTO] __initdata;
/*