cros_ec: Better error checking for cros_ec_board_version

This makes cros_ec_board_version return a negative value if the
command fails.

Currently only Rambi used this function. I updated rambi_dimm_count()
to return an error if it fails, but rambi_get_version() can remain
unchanged since valstr() will give us "Unknown" for a bad value.

TEST=tested with follow-up patches

Change-Id: Ib9d7c15c0b158c609a05e56c4db41a3f8343546a
Signed-off-by: David Hendricks <>
Reviewed-by: Aaron Durbin <>
2 files changed