platform/chrome: cros_ec_sysfs: Modify error handling
authorGwendal Grignou <gwendal@chromium.org>
Fri, 23 Mar 2018 17:42:42 +0000 (18:42 +0100)
committerBenson Leung <bleung@chromium.org>
Wed, 11 Apr 2018 05:22:34 +0000 (22:22 -0700)
commit311394248ca539c12b33d396b2944e03cd0d6bfc
tree5866aa9ab73fe9ed3ebb7717bf7bcefda1032de5
parent3eb2ce825ea1ad89d20f7a3b5780df850e4be274
platform/chrome: cros_ec_sysfs: Modify error handling

When accessing a sysfs attribute, if the EC command fails, -EPROTO is
now returned instead of an error message as it is unlikely an app is
parsing the error message to do something meaningful.
Also, this patch makes use of cros_ec_cmd_xfer_status() instead of
cros_ec_cmd_xfer() so an error message is printed in the syslog.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
drivers/platform/chrome/cros_ec_sysfs.c