fuility/: Factor out flash servo setup and teardown functions

These helpers are suitable for use in other subcommands
that duplicate this logic such as cmd_read.c.

Squash in,
 futility/cmd_read.c: Drop dup servo logic to use setup_flash()
 futility/cmd_flash_util.c: Drop dup servo logic to use setup_flash()

The setup_flash() and teardown_flash() helpers already perform this
work as-is-implemented for the cmd_gbb subcommand. Therefore reuse
that logic accordingly.

BUG=b:283890697, b:283024460
BRANCH=none
TEST=`cros_run_unit_tests --host --packages vboot_reference`.

Change-Id: I09c8bdfd9abafe9f7ad393156c58d8a54cdcc2be
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4554128
Auto-Submit: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Chung-sheng Wu <chungsheng@google.com>
Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
7 files changed