1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

par_master: Fix propagation of register_par_master() return values

This patch checks return value of register_par_master()
so that in case of an error this error is not ignored anymore.

BUG=b:185191942
TEST=builds and ninja test

Change-Id: I377afae41708c7433a56615e2f096bce9c5349f1
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57192
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Anastasia Klimchuk 2021-08-27 15:47:46 +10:00 committed by Edward O'Callaghan
parent 31b283bd21
commit 099e378512
10 changed files with 10 additions and 28 deletions

View File

@ -85,9 +85,7 @@ static int atahpt_init(void)
reg32 |= (1 << 24); reg32 |= (1 << 24);
rpci_write_long(dev, REG_FLASH_ACCESS, reg32); rpci_write_long(dev, REG_FLASH_ACCESS, reg32);
register_par_master(&par_master_atahpt, BUS_PARALLEL, NULL); return register_par_master(&par_master_atahpt, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_atahpt = { const struct programmer_entry programmer_atahpt = {

View File

@ -152,14 +152,13 @@ static int atapromise_init(void)
} }
max_rom_decode.parallel = rom_size; max_rom_decode.parallel = rom_size;
register_par_master(&par_master_atapromise, BUS_PARALLEL, NULL);
msg_pwarn("Do not use this device as a generic programmer. It will leave anything outside\n" msg_pwarn("Do not use this device as a generic programmer. It will leave anything outside\n"
"the first %zu kB of the flash chip in an undefined state. It works fine for the\n" "the first %zu kB of the flash chip in an undefined state. It works fine for the\n"
"purpose of updating the firmware of this device (padding may necessary).\n", "purpose of updating the firmware of this device (padding may necessary).\n",
rom_size / 1024); rom_size / 1024);
return 0; return register_par_master(&par_master_atapromise, BUS_PARALLEL, NULL);
} }
const struct programmer_entry programmer_atapromise = { const struct programmer_entry programmer_atapromise = {

View File

@ -184,9 +184,7 @@ static int atavia_init(void)
return 1; return 1;
} }
register_par_master(&lpc_master_atavia, BUS_LPC, NULL); return register_par_master(&lpc_master_atavia, BUS_LPC, NULL);
return 0;
} }
const struct programmer_entry programmer_atavia = { const struct programmer_entry programmer_atavia = {

View File

@ -85,9 +85,7 @@ static int drkaiser_init(void)
return 1; return 1;
max_rom_decode.parallel = 128 * 1024; max_rom_decode.parallel = 128 * 1024;
register_par_master(&par_master_drkaiser, BUS_PARALLEL, NULL); return register_par_master(&par_master_drkaiser, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_drkaiser = { const struct programmer_entry programmer_drkaiser = {

View File

@ -111,9 +111,7 @@ static int gfxnvidia_init(void)
/* Write/erase doesn't work. */ /* Write/erase doesn't work. */
programmer_may_write = 0; programmer_may_write = 0;
register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, NULL); return register_par_master(&par_master_gfxnvidia, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_gfxnvidia = { const struct programmer_entry programmer_gfxnvidia = {

View File

@ -75,8 +75,7 @@ static int it8212_init(void)
rpci_write_long(dev, PCI_ROM_ADDRESS, io_base_addr | 0x01); rpci_write_long(dev, PCI_ROM_ADDRESS, io_base_addr | 0x01);
max_rom_decode.parallel = IT8212_MEMMAP_SIZE; max_rom_decode.parallel = IT8212_MEMMAP_SIZE;
register_par_master(&par_master_it8212, BUS_PARALLEL, NULL); return register_par_master(&par_master_it8212, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_it8212 = { const struct programmer_entry programmer_it8212 = {
.name = "it8212", .name = "it8212",

View File

@ -107,9 +107,7 @@ static int nicintel_init(void)
pci_rmmio_writew(0x0001, nicintel_control_bar + CSR_FCR); pci_rmmio_writew(0x0001, nicintel_control_bar + CSR_FCR);
max_rom_decode.parallel = NICINTEL_MEMMAP_SIZE; max_rom_decode.parallel = NICINTEL_MEMMAP_SIZE;
register_par_master(&par_master_nicintel, BUS_PARALLEL, NULL); return register_par_master(&par_master_nicintel, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_nicintel = { const struct programmer_entry programmer_nicintel = {

View File

@ -97,9 +97,7 @@ static int nicnatsemi_init(void)
* functions below wants to be 0x0000FFFF. * functions below wants to be 0x0000FFFF.
*/ */
max_rom_decode.parallel = 131072; max_rom_decode.parallel = 131072;
register_par_master(&par_master_nicnatsemi, BUS_PARALLEL, NULL); return register_par_master(&par_master_nicnatsemi, BUS_PARALLEL, NULL);
return 0;
} }

View File

@ -179,9 +179,7 @@ static int satamv_init(void)
/* 512 kByte with two 8-bit latches, and /* 512 kByte with two 8-bit latches, and
* 4 MByte with additional 3-bit latch. */ * 4 MByte with additional 3-bit latch. */
max_rom_decode.parallel = 4 * 1024 * 1024; max_rom_decode.parallel = 4 * 1024 * 1024;
register_par_master(&par_master_satamv, BUS_PARALLEL, NULL); return register_par_master(&par_master_satamv, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_satamv = { const struct programmer_entry programmer_satamv = {

View File

@ -129,9 +129,7 @@ static int satasii_init(void)
if ((id != 0x0680) && (!(pci_mmio_readl(sii_bar) & (1 << 26)))) if ((id != 0x0680) && (!(pci_mmio_readl(sii_bar) & (1 << 26))))
msg_pwarn("Warning: Flash seems unconnected.\n"); msg_pwarn("Warning: Flash seems unconnected.\n");
register_par_master(&par_master_satasii, BUS_PARALLEL, NULL); return register_par_master(&par_master_satasii, BUS_PARALLEL, NULL);
return 0;
} }
const struct programmer_entry programmer_satasii = { const struct programmer_entry programmer_satasii = {
.name = "satasii", .name = "satasii",