iriver_flash: add macros to reduce the rom chip table

The table is now gated by the FLASH_SIZE macro as any given
target will not have a known rom chip of a differing size
than the FLASH_SIZE. This will reduce the resulting code
a bit as well.

Change-Id: I06a283f9f44118080a106e1bcd410e81e0a48d92
This commit is contained in:
James Buren 2020-11-14 18:35:00 +00:00 committed by William Wilgus
parent 7d9ac021b5
commit c10eea46a9

View file

@ -141,8 +141,13 @@ static bool flash_get_info(const struct flash_info** out_info)
{
static const struct flash_info roms[] =
{
#if FLASH_SIZE == 2048 * 1024
{ 0x00BF, 0x2782, 2048 * 1024, "SST39VF160" },
#elif FLASH_SIZE == 4096 * 1024
{ 0x00BF, 0x235B, 4096 * 1024, "SST39VF3201" },
#else
#error "Unsupported rom chip."
#endif
{0}
};
static struct flash_info unknown_rom = {0};