1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

nicintel_eeprom: handle errors using goto for i210's shutdown

This patch prepares the programmer to move global singleton states
into a struct.

TOPIC=register_master_api
TEST=builds

Change-Id: Idb4f75fa92966a0fffd83dd0e297f5f51f6c0bd3
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66491
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Alexander Goncharov 2022-08-07 12:08:49 +03:00 committed by Anastasia Klimchuk
parent bbf20776f8
commit 0b654bb92e

View File

@ -397,8 +397,10 @@ static int nicintel_ee_erase_82580(struct flashctx *flash, unsigned int addr, un
static int nicintel_ee_shutdown_i210(void *arg)
{
int ret = 0;
if (!done_i20_write)
return 0;
goto out;
uint32_t flup = pci_mmio_readl(nicintel_eebar + EEC);
@ -408,11 +410,13 @@ static int nicintel_ee_shutdown_i210(void *arg)
int i;
for (i = 0; i < MAX_ATTEMPTS; i++)
if (pci_mmio_readl(nicintel_eebar + EEC) & BIT(EE_FLUDONE))
return 0;
goto out;
ret = -1;
msg_perr("Flash update failed\n");
return -1;
out:
return ret;
}
static int nicintel_ee_shutdown_82580(void *eecp)