platform/chrome: cros_ec_proto: Report command not supported
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Thu, 20 Feb 2020 15:58:52 +0000 (16:58 +0100)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 2 Mar 2020 10:04:05 +0000 (11:04 +0100)
commitc5cd2b47b203f63682778c2a1783198e6b644294
treea34da01dc68fa6c3c49e3c4924150dafc52316e0
parent7d3ca507fda9b60544bb86b9ef89cadc14755d70
platform/chrome: cros_ec_proto: Report command not supported

In practice most drivers that use the EC protocol what really care is if
the result was successful or not, hence, we introduced a
cros_ec_cmd_xfer_status() function that converts EC errors to standard
Linux error codes. On some few cases, though, we are interested on know
if the command is supported or not, and in such cases, just ignore the
error. To achieve this, return a -ENOTSUPP error when the command is not
supported.

This will allow us to finish the conversion of all users to use the
cros_ec_cmd_xfer_status() function instead of cros_ec_cmd_xfer() and
make the latest private to the protocol driver, so users of the protocol
are not confused in which function they should use.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Prashant Malani <pmalani@chromium.org>
drivers/platform/chrome/cros_ec_proto.c