diff options
author | Nico Huber <nico.huber@secunet.com> | 2016-04-29 18:39:01 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2017-06-03 20:19:30 +0200 |
commit | 899e4ec810a1e2f3d377bc2095ba3d25b234a797 (patch) | |
tree | 270ac1d7101251d95a295effcbe5cf01ce2250f4 /cli_classic.c | |
parent | 1878110848f36c53667c9855f0a413c43e64597f (diff) | |
download | flashrom-899e4ec810a1e2f3d377bc2095ba3d25b234a797.tar.gz flashrom-899e4ec810a1e2f3d377bc2095ba3d25b234a797.tar.bz2 flashrom-899e4ec810a1e2f3d377bc2095ba3d25b234a797.zip |
Kill doit()
No words can describe this feeling.
v2: Rejoice while removing more, orphaned code (layout.c).
Change-Id: Id81177c50b4410e68dcf8ebab48386a94cd9b714
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17949
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/cli_classic.c b/cli_classic.c index 984a4dac..00baf490 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -530,24 +530,28 @@ int main(int argc, char *argv[]) goto out_shutdown; } - /* Always verify write operations unless -n is used. */ - if (write_it && !dont_verify_it) - verify_it = 1; + if (layoutfile) + flashrom_layout_set(fill_flash, get_global_layout()); - /* Map the selected flash chip again. */ - if (map_flash(fill_flash) != 0) { - ret = 1; - goto out_shutdown; - } + flashrom_flag_set(fill_flash, FLASHROM_FLAG_FORCE, !!force); + flashrom_flag_set(fill_flash, FLASHROM_FLAG_FORCE_BOARDMISMATCH, !!force_boardmismatch); + flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_AFTER_WRITE, !dont_verify_it); + flashrom_flag_set(fill_flash, FLASHROM_FLAG_VERIFY_WHOLE_CHIP, true); /* FIXME: We should issue an unconditional chip reset here. This can be * done once we have a .reset function in struct flashchip. * Give the chip time to settle. */ programmer_delay(100000); - ret |= doit(fill_flash, force, filename, read_it, write_it, erase_it, verify_it); + if (read_it) + ret = do_read(fill_flash, filename); + else if (erase_it) + ret = do_erase(fill_flash); + else if (write_it) + ret = do_write(fill_flash, filename); + else if (verify_it) + ret = do_verify(fill_flash, filename); - unmap_flash(fill_flash); out_shutdown: programmer_shutdown(); out: |