| .. | .. |
|---|
| 22 | 22 | #include <linux/slab.h> |
|---|
| 23 | 23 | #include <linux/sysrq.h> |
|---|
| 24 | 24 | #include <linux/input/matrix_keypad.h> |
|---|
| 25 | | -#include <linux/mfd/cros_ec.h> |
|---|
| 26 | | -#include <linux/mfd/cros_ec_commands.h> |
|---|
| 25 | +#include <linux/platform_data/cros_ec_commands.h> |
|---|
| 26 | +#include <linux/platform_data/cros_ec_proto.h> |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | #include <asm/unaligned.h> |
|---|
| 29 | 29 | |
|---|
| .. | .. |
|---|
| 348 | 348 | params->info_type = info_type; |
|---|
| 349 | 349 | params->event_type = event_type; |
|---|
| 350 | 350 | |
|---|
| 351 | | - ret = cros_ec_cmd_xfer(ec_dev, msg); |
|---|
| 352 | | - if (ret < 0) { |
|---|
| 353 | | - dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", |
|---|
| 354 | | - (int)info_type, (int)event_type, ret); |
|---|
| 355 | | - } else if (msg->result == EC_RES_INVALID_VERSION) { |
|---|
| 351 | + ret = cros_ec_cmd_xfer_status(ec_dev, msg); |
|---|
| 352 | + if (ret == -ENOPROTOOPT) { |
|---|
| 356 | 353 | /* With older ECs we just return 0 for everything */ |
|---|
| 357 | 354 | memset(result, 0, result_size); |
|---|
| 358 | 355 | ret = 0; |
|---|
| 359 | | - } else if (msg->result != EC_RES_SUCCESS) { |
|---|
| 360 | | - dev_warn(ec_dev->dev, "Error getting info %d/%d: %d\n", |
|---|
| 361 | | - (int)info_type, (int)event_type, msg->result); |
|---|
| 362 | | - ret = -EPROTO; |
|---|
| 356 | + } else if (ret < 0) { |
|---|
| 357 | + dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", |
|---|
| 358 | + (int)info_type, (int)event_type, ret); |
|---|
| 363 | 359 | } else if (ret != result_size) { |
|---|
| 364 | 360 | dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n", |
|---|
| 365 | 361 | (int)info_type, (int)event_type, |
|---|