[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200205190028.183069-4-pmalani@chromium.org>
Date: Wed, 5 Feb 2020 10:59:59 -0800
From: Prashant Malani <pmalani@...omium.org>
To: linux-kernel@...r.kernel.org
Cc: Prashant Malani <pmalani@...omium.org>,
Benson Leung <bleung@...omium.org>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
Guenter Roeck <groeck@...omium.org>
Subject: [PATCH v2 03/17] platform/chrome: proto: Use cros_ec_cmd()
Replace the use of cros_ec_cmd_xfer_status() with the new function
cros_ec_cmd().
Signed-off-by: Prashant Malani <pmalani@...omium.org>
---
Changes in v2:
- Updated to use new function name and parameter list.
drivers/platform/chrome/cros_ec_proto.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
index b3d5368f596813..aa7ae1f394cc91 100644
--- a/drivers/platform/chrome/cros_ec_proto.c
+++ b/drivers/platform/chrome/cros_ec_proto.c
@@ -811,31 +811,20 @@ EXPORT_SYMBOL(cros_ec_get_host_event);
*/
int cros_ec_check_features(struct cros_ec_dev *ec, int feature)
{
- struct cros_ec_command *msg;
int ret;
if (ec->features[0] == -1U && ec->features[1] == -1U) {
/* features bitmap not read yet */
- msg = kzalloc(sizeof(*msg) + sizeof(ec->features), GFP_KERNEL);
- if (!msg)
- return -ENOMEM;
-
- msg->command = EC_CMD_GET_FEATURES + ec->cmd_offset;
- msg->insize = sizeof(ec->features);
-
- ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg);
+ ret = cros_ec_cmd(ec->ec_dev, 0,
+ ec->cmd_offset + EC_CMD_GET_FEATURES, NULL, 0,
+ ec->features, sizeof(ec->features), NULL);
if (ret < 0) {
- dev_warn(ec->dev, "cannot get EC features: %d/%d\n",
- ret, msg->result);
+ dev_warn(ec->dev, "cannot get EC features: %d\n", ret);
memset(ec->features, 0, sizeof(ec->features));
- } else {
- memcpy(ec->features, msg->data, sizeof(ec->features));
}
dev_dbg(ec->dev, "EC features %08x %08x\n",
ec->features[0], ec->features[1]);
-
- kfree(msg);
}
return ec->features[feature / 32] & EC_FEATURE_MASK_0(feature);
--
2.25.0.341.g760bfbb309-goog
Powered by blists - more mailing lists