Re: [PATCH v3 6/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes

2020-07-29 Thread Brian Norris
On Wed, Jul 29, 2020 at 4:22 PM Guenter Roeck wrote: > On 7/29/20 3:21 PM, Brian Norris wrote: > > On Sun, Jul 26, 2020 at 03:01:01PM -0700, Guenter Roeck wrote: > >> --- a/drivers/platform/chrome/cros_ec_proto.c > >> +++ b/drivers/platform/chrome/cros_ec_proto.c > > ^^ Maybe we want to double

Re: [PATCH v3 6/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes

2020-07-29 Thread Guenter Roeck
On 7/29/20 3:21 PM, Brian Norris wrote: > Hi Guenter, > > On Sun, Jul 26, 2020 at 03:01:01PM -0700, Guenter Roeck wrote: >> v3: Use -ENOPROTOOPT for EC_RES_INVALID_VERSION >> Implement function to convert error codes >> v2: No change >> >> drivers/platform/chrome/cros_ec_proto.c | 52

Re: [PATCH v3 6/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes

2020-07-29 Thread Brian Norris
Hi Guenter, On Sun, Jul 26, 2020 at 03:01:01PM -0700, Guenter Roeck wrote: > v3: Use -ENOPROTOOPT for EC_RES_INVALID_VERSION > Implement function to convert error codes > v2: No change > > drivers/platform/chrome/cros_ec_proto.c | 52 - > 1 file changed, 42

[PATCH v3 6/6] platform/chrome: cros_ec_proto: Convert EC error codes to Linux error codes

2020-07-26 Thread Guenter Roeck
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