[PATCH v2 04/17] platform/chrome: usbpd_logger: Use cros_ec_cmd()

From: Prashant Malani
Date: Wed Feb 05 2020 - 14:06:00 EST


Convert the earlier call of cros_ec_cmd_xfer_status() to
cros_ec_cmd() which does the buffer setup and message allocation.

Signed-off-by: Prashant Malani <pmalani@xxxxxxxxxxxx>
---

Changes in v2:
- Updated to use new function name and parameter list.

drivers/platform/chrome/cros_usbpd_logger.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/chrome/cros_usbpd_logger.c b/drivers/platform/chrome/cros_usbpd_logger.c
index 7de3ea75ef46eb..084b6d4b692128 100644
--- a/drivers/platform/chrome/cros_usbpd_logger.c
+++ b/drivers/platform/chrome/cros_usbpd_logger.c
@@ -61,19 +61,15 @@ static int append_str(char *buf, int pos, const char *fmt, ...)
static struct ec_response_pd_log *ec_get_log_entry(struct logger_data *logger)
{
struct cros_ec_dev *ec_dev = logger->ec_dev;
- struct cros_ec_command *msg;
int ret;

- msg = (struct cros_ec_command *)logger->ec_buffer;
-
- msg->command = ec_dev->cmd_offset + EC_CMD_PD_GET_LOG_ENTRY;
- msg->insize = CROS_USBPD_LOG_RESP_SIZE;
-
- ret = cros_ec_cmd_xfer_status(ec_dev->ec_dev, msg);
+ ret = cros_ec_cmd(ec_dev->ec_dev, 0,
+ ec_dev->cmd_offset + EC_CMD_PD_GET_LOG_ENTRY, NULL, 0,
+ logger->ec_buffer, CROS_USBPD_LOG_RESP_SIZE, NULL);
if (ret < 0)
return ERR_PTR(ret);

- return (struct ec_response_pd_log *)msg->data;
+ return (struct ec_response_pd_log *)logger->ec_buffer;
}

static void cros_usbpd_print_log_entry(struct ec_response_pd_log *r,
--
2.25.0.341.g760bfbb309-goog