summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-11-23 22:37:19 +1100
committerEdward O'Callaghan <quasisec@chromium.org>2023-03-22 21:19:09 +0000
commit5cff668d1ad152e3f70f725e667b23690e2d9f1a (patch)
treee724ecd415a611543a80b5f6f790d25e9305559d /flashrom.c
parente1cdbdbbfb98a28fe7198ae6cd3e571269a04403 (diff)
downloadflashrom-5cff668d1ad152e3f70f725e667b23690e2d9f1a.tar.gz
flashrom-5cff668d1ad152e3f70f725e667b23690e2d9f1a.tar.bz2
flashrom-5cff668d1ad152e3f70f725e667b23690e2d9f1a.zip
tree/: Convert printlock func ptr into enumerate values
Converting the printlock function pointer within the flashchip struct into enum values allows for the flashchips db to be turn into pure, declarative data. A nice side-effect of this is to reduce link-time symbol space of chipdrivers and increase modularity of the spi25_statusreg.c and related implementations. BUG=none TEST=ninja test. Change-Id: I9131348f72c1010e2c213dca4dc4b675a8d8681e Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/69934 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sam McNally <sammc@google.com> Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/flashrom.c b/flashrom.c
index c5b795c19..b135e5807 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1179,9 +1179,11 @@ notfound:
/* Flash registers may more likely not be mapped if the chip was forced.
* Lock info may be stored in registers, so avoid lock info printing. */
- if (!force)
- if (flash->chip->printlock)
- flash->chip->printlock(flash);
+ if (!force) {
+ printlockfunc_t *printlock = lookup_printlock_func_ptr(flash);
+ if (printlock)
+ printlock(flash);
+ }
/* Get out of the way for later runs. */
unmap_flash(flash);