summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-cros-ec.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2020-08-22 18:08:56 +0300
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2020-08-24 12:37:34 +0300
commit0d080459e813ce8076f183cc73a4c9b64a39a4d8 (patch)
tree628f6a316b6ee66e5ac0b0bc486b060669d52d0f /drivers/pwm/pwm-cros-ec.c
parentb4e452b5e97dc70d529475168a37ad7394994b8b (diff)
downloadlinux-0d080459e813ce8076f183cc73a4c9b64a39a4d8.tar.xz
platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes
The EC reports a variety of error codes. Most of those, with the exception of EC_RES_INVALID_VERSION, are converted to -EPROTO. As result, the actual EC error code gets lost. Introduce cros_ec_map_error() to map EC error codes to Linux error codes, and use it in cros_ec_cmd_xfer_status() to report more meaningful errors to the caller. With this change, callers of cros_ec_cmd_xfer_status() can implement a more distinguished action without having to rely on the EC error code. At the same time, debugging is improved in situations where the Linux error code is reported to userspace and/or in the kernel log. Cc: Gwendal Grignou <gwendal@chromium.org> Cc: Yu-Hsuan Hsu <yuhsuan@chromium.org> Cc: Prashant Malani <pmalani@chromium.org> Cc: Brian Norris <briannorris@chromium.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/pwm/pwm-cros-ec.c')
0 files changed, 0 insertions, 0 deletions