1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 06:01:16 +02:00

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>
This commit is contained in:
Nico Huber
2016-04-29 18:39:01 +02:00
committed by Nico Huber
parent 1878110848
commit 899e4ec810
4 changed files with 91 additions and 418 deletions

View File

@ -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: