diff options
author | Edward O'Callaghan <quasisec@google.com> | 2021-12-13 12:30:03 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2022-01-22 00:04:00 +0000 |
commit | 7a2d7efd83ff50507192bba01dbad1a411e22b25 (patch) | |
tree | 1151de0c68e2f4367e833772f26661fa84ed7298 /flashrom.c | |
parent | f136a2a69c649c785669496d8bbd04b900724e77 (diff) | |
download | flashrom-7a2d7efd83ff50507192bba01dbad1a411e22b25.tar.gz flashrom-7a2d7efd83ff50507192bba01dbad1a411e22b25.tar.bz2 flashrom-7a2d7efd83ff50507192bba01dbad1a411e22b25.zip |
cli_classic.c: Convert do_erase() to libflashrom call
Inline emergency_help_message() to cli_classic call site.
This leaves do_erase() a redudant wrapper and moves us a step
closer to cli_classic as a pure libflashrom user by using
flashrom_flash_erase().
BUG=b:208132085
TEST=`flashrom -E`
Change-Id: I8566164e7dbad69cf478b24208014f10fb99e4d0
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/60068
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'flashrom.c')
-rw-r--r-- | flashrom.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/flashrom.c b/flashrom.c index dd443b934..1cdddab82 100644 --- a/flashrom.c +++ b/flashrom.c @@ -1553,7 +1553,7 @@ static void nonfatal_help_message(void) "https://www.flashrom.org/Contact for details), thanks!\n"); } -static void emergency_help_message(void) +void emergency_help_message(void) { msg_gerr("Your flash chip is in an unknown state.\n"); #if CONFIG_INTERNAL == 1 @@ -2208,23 +2208,6 @@ int do_extract(struct flashctx *const flash) return do_read(flash, NULL); } -int do_erase(struct flashctx *const flash) -{ - const int ret = flashrom_flash_erase(flash); - - /* - * FIXME: Do we really want the scary warning if erase failed? - * After all, after erase the chip is either blank or partially - * blank or it has the old contents. A blank chip won't boot, - * so if the user wanted erase and reboots afterwards, the user - * knows very well that booting won't work. - */ - if (ret) - emergency_help_message(); - - return ret; -} - int do_write(struct flashctx *const flash, const char *const filename, const char *const referencefile) { const size_t flash_size = flash->chip->total_size * 1024; |