Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: cros_ec_keyb - use cros_ec_cmd_xfer_status helper

This patch makes use of cros_ec_cmd_xfer_status() instead of
cros_ec_cmd_xfer(). In this case there is no advantage of doing this
apart from that we want to make cros_ec_cmd_xfer() a private function
for the EC protocol and let people only use the
cros_ec_cmd_xfer_status() to return Linux standard error codes.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20200414210434.1534982-1-enric.balletbo@collabora.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Enric Balletbo i Serra and committed by
Dmitry Torokhov
0bcee119 3f8f7705

+5 -9
+5 -9
drivers/input/keyboard/cros_ec_keyb.c
··· 347 347 params->info_type = info_type; 348 348 params->event_type = event_type; 349 349 350 - ret = cros_ec_cmd_xfer(ec_dev, msg); 351 - if (ret < 0) { 352 - dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", 353 - (int)info_type, (int)event_type, ret); 354 - } else if (msg->result == EC_RES_INVALID_VERSION) { 350 + ret = cros_ec_cmd_xfer_status(ec_dev, msg); 351 + if (ret == -ENOTSUPP) { 355 352 /* With older ECs we just return 0 for everything */ 356 353 memset(result, 0, result_size); 357 354 ret = 0; 358 - } else if (msg->result != EC_RES_SUCCESS) { 359 - dev_warn(ec_dev->dev, "Error getting info %d/%d: %d\n", 360 - (int)info_type, (int)event_type, msg->result); 361 - ret = -EPROTO; 355 + } else if (ret < 0) { 356 + dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", 357 + (int)info_type, (int)event_type, ret); 362 358 } else if (ret != result_size) { 363 359 dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n", 364 360 (int)info_type, (int)event_type,