A follow-up patch will extend the number of errors reported by
cros_ec_cmd_xfer_status(). Specifically, the function will return
-EOPNOTSUPP if a command is not supported by the EC. Prepare for it.

Cc: Gwendal Grignou <gwen...@chromium.org>
Cc: Yu-Hsuan Hsu <yuhs...@chromium.org>
Cc: Prashant Malani <pmal...@chromium.org>
Cc: Brian Norris <briannor...@chromium.org>
Acked-by: Jonathan Cameron <jonathan.came...@huawei.com>
Reviewed-by: Brian Norris <briannor...@chromium.org>
Signed-off-by: Guenter Roeck <li...@roeck-us.net>
---
v4: No change
v3: No change
v2: No change

 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c 
b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
index a66941fdb385..e3aff95493dd 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
@@ -73,7 +73,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev,
                st->core.param.sensor_offset.flags = 0;
 
                ret = cros_ec_motion_send_host_cmd(&st->core, 0);
-               if (ret == -EPROTO) {
+               if (ret == -EPROTO || ret == -EOPNOTSUPP) {
                        /* Reading calibscale is not supported on older EC. */
                        *val = 1;
                        *val2 = 0;
-- 
2.17.1

Reply via email to