diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2019-01-09 18:07:07 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-10 13:58:48 -0800 |
commit | 009cf13f5e499e82445d0077596dcfe2e4bb4b14 (patch) | |
tree | 4f76a3805f24f6d14c73c3011fbe851458e1320e /util/comm-host.c | |
parent | cac2bbe86d867ed428c37f1b5b34fcf8594fcc24 (diff) | |
download | chrome-ec-009cf13f5e499e82445d0077596dcfe2e4bb4b14.tar.gz |
ectool: fix battery command
This patch fixes the ec_readmem function pointer, which is currently
set to fake_readmem unconditionally.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/122568808
BRANCH=none
TEST=Verify 'ectool battery' runs successfully on Nami.
Change-Id: I2d57d0ca7103d9b9a1e44e685bc966d158a16a47
Reviewed-on: https://chromium-review.googlesource.com/1404148
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'util/comm-host.c')
-rw-r--r-- | util/comm-host.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/comm-host.c b/util/comm-host.c index e9e7fb1f5f..f8be25294c 100644 --- a/util/comm-host.c +++ b/util/comm-host.c @@ -84,6 +84,9 @@ int ec_command(int command, int version, int comm_init_alt(int interfaces, const char *device_name) { + /* Default memmap access */ + ec_readmem = fake_readmem; + if ((interfaces & COMM_SERVO) && comm_init_servo_spi && !comm_init_servo_spi(device_name)) return 0; @@ -110,9 +113,6 @@ int comm_init_buffer(void) int allow_large_buffer; struct ec_response_get_protocol_info info; - /* Default memmap access */ - ec_readmem = fake_readmem; - allow_large_buffer = kernel_version_ge(3, 14, 0); if (allow_large_buffer < 0) { fprintf(stderr, "Unable to check linux version\n"); |