diff options
author | Anastasia Klimchuk <aklm@chromium.org> | 2021-08-26 10:30:16 +1000 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2021-08-30 02:42:57 +0000 |
commit | d681ab286a8e07900ec62c3e6a2912949dce870f (patch) | |
tree | 7a978342e286fc336670f30e7f9dc8c81bcace1a | |
parent | d1697e9abe2436a470e3ea6c8061f1e23e0d597b (diff) | |
download | flashrom-d681ab286a8e07900ec62c3e6a2912949dce870f.tar.gz flashrom-d681ab286a8e07900ec62c3e6a2912949dce870f.tar.bz2 flashrom-d681ab286a8e07900ec62c3e6a2912949dce870f.zip |
par_master: Move shutdown function above par_master struct
This patch prepares par masters to use new API which allows to
register shutdown function in par_master struct. See also later
patch in this chain, where par masters are converted to new API.
BUG=b:185191942
TEST=builds and ninja test
Comparing flashrom binary before and after the patch,
make clean && make CONFIG_EVERYTHING=yes VERSION=none
binary is the same
Change-Id: I87e9ce0ad9b39b39645dc24cb0d75d1e7a6d9047
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57155
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
-rw-r--r-- | nic3com.c | 22 | ||||
-rw-r--r-- | nicrealtek.c | 14 |
2 files changed, 18 insertions, 18 deletions
@@ -73,17 +73,6 @@ static uint8_t nic3com_chip_readb(const struct flashctx *flash, return INB(data->io_base_addr + BIOS_ROM_DATA); } -static const struct par_master par_master_nic3com = { - .chip_readb = nic3com_chip_readb, - .chip_readw = fallback_chip_readw, - .chip_readl = fallback_chip_readl, - .chip_readn = fallback_chip_readn, - .chip_writeb = nic3com_chip_writeb, - .chip_writew = fallback_chip_writew, - .chip_writel = fallback_chip_writel, - .chip_writen = fallback_chip_writen, -}; - static int nic3com_shutdown(void *par_data) { struct nic3com_data *data = par_data; @@ -101,6 +90,17 @@ static int nic3com_shutdown(void *par_data) return 0; } +static const struct par_master par_master_nic3com = { + .chip_readb = nic3com_chip_readb, + .chip_readw = fallback_chip_readw, + .chip_readl = fallback_chip_readl, + .chip_readn = fallback_chip_readn, + .chip_writeb = nic3com_chip_writeb, + .chip_writew = fallback_chip_writew, + .chip_writel = fallback_chip_writel, + .chip_writen = fallback_chip_writen, +}; + static int nic3com_init(void) { struct pci_dev *dev = NULL; diff --git a/nicrealtek.c b/nicrealtek.c index 81d305ba8..b8125f410 100644 --- a/nicrealtek.c +++ b/nicrealtek.c @@ -79,6 +79,13 @@ static uint8_t nicrealtek_chip_readb(const struct flashctx *flash, const chipadd return val; } +static int nicrealtek_shutdown(void *data) +{ + /* FIXME: We forgot to disable software access again. */ + free(data); + return 0; +} + static const struct par_master par_master_nicrealtek = { .chip_readb = nicrealtek_chip_readb, .chip_readw = fallback_chip_readw, @@ -90,13 +97,6 @@ static const struct par_master par_master_nicrealtek = { .chip_writen = fallback_chip_writen, }; -static int nicrealtek_shutdown(void *data) -{ - /* FIXME: We forgot to disable software access again. */ - free(data); - return 0; -} - static int nicrealtek_init(void) { struct pci_dev *dev = NULL; |