aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-cros-ec.c
diff options
context:
space:
mode:
authorGuenter Roeck <[email protected]>2020-08-22 08:08:56 -0700
committerEnric Balletbo i Serra <[email protected]>2020-08-24 11:37:34 +0200
commit0d080459e813ce8076f183cc73a4c9b64a39a4d8 (patch)
tree628f6a316b6ee66e5ac0b0bc486b060669d52d0f /drivers/pwm/pwm-cros-ec.c
parentb4e452b5e97dc70d529475168a37ad7394994b8b (diff)
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 <[email protected]> Cc: Yu-Hsuan Hsu <[email protected]> Cc: Prashant Malani <[email protected]> Cc: Brian Norris <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-cros-ec.c')
0 files changed, 0 insertions, 0 deletions