mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
nicintel_eeprom: unify the code path of opaque master registration
TOPIC=register_master_api TEST=builds Change-Id: I9f5f181fe4497ac95e89df8588522a40ba8be024 Signed-off-by: Alexander Goncharov <chat@joursoir.net> Ticket: https://ticket.coreboot.org/issues/391 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66158 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
3234e04743
commit
7ebb18985d
@ -474,6 +474,7 @@ static const struct opaque_master opaque_master_nicintel_ee_i210 = {
|
||||
|
||||
static int nicintel_ee_init(void)
|
||||
{
|
||||
const struct opaque_master *mst;
|
||||
uint32_t eec = 0;
|
||||
|
||||
struct pci_dev *dev = pcidev_init(nics_intel_ee, PCI_BASE_ADDRESS_0);
|
||||
@ -502,32 +503,25 @@ static int nicintel_ee_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
struct nicintel_eeprom_data *data = calloc(1, sizeof(*data));
|
||||
if (!data) {
|
||||
msg_perr("Unable to allocate space for OPAQUE master data\n");
|
||||
return 1;
|
||||
}
|
||||
data->eec = eec;
|
||||
|
||||
return register_opaque_master(&opaque_master_nicintel_ee_82580, data);
|
||||
mst = &opaque_master_nicintel_ee_82580;
|
||||
} else {
|
||||
nicintel_eebar = rphysmap("Intel i210 NIC w/ emulated EEPROM",
|
||||
io_base_addr + 0x12000, MEMMAP_SIZE);
|
||||
if (!nicintel_eebar)
|
||||
return 1;
|
||||
|
||||
struct nicintel_eeprom_data *data = calloc(1, sizeof(*data));
|
||||
if (!data) {
|
||||
msg_perr("Unable to allocate space for OPAQUE master data\n");
|
||||
return 1;
|
||||
}
|
||||
data->eec = eec;
|
||||
data->done_i20_write = false;
|
||||
|
||||
return register_opaque_master(&opaque_master_nicintel_ee_i210, data);
|
||||
mst = &opaque_master_nicintel_ee_i210;
|
||||
}
|
||||
|
||||
return 1;
|
||||
struct nicintel_eeprom_data *data = calloc(1, sizeof(*data));
|
||||
if (!data) {
|
||||
msg_perr("Unable to allocate space for OPAQUE master data\n");
|
||||
return 1;
|
||||
}
|
||||
data->eec = eec;
|
||||
data->done_i20_write = false;
|
||||
|
||||
return register_opaque_master(mst, data);
|
||||
}
|
||||
|
||||
const struct programmer_entry programmer_nicintel_eeprom = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user