Skip to content

Commit 5d12225

Browse files
Prashant MalaniEnric Balletbo i Serra
authored andcommitted
platform/chrome: cros_ec_proto: Make data pointers void
Convert the input and output data pointers for cros_ec_command() to void pointers so that the callers don't have to cast their custom structs to uint8_t *. Signed-off-by: Prashant Malani <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7101c83 commit 5d12225

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/platform/chrome/cros_ec_proto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,9 @@ EXPORT_SYMBOL_GPL(cros_ec_get_sensor_count);
925925
*/
926926
int cros_ec_command(struct cros_ec_device *ec_dev,
927927
int command,
928-
uint8_t *outdata,
928+
void *outdata,
929929
int outsize,
930-
uint8_t *indata,
930+
void *indata,
931931
int insize)
932932
{
933933
struct cros_ec_command *msg;

drivers/platform/chrome/cros_usbpd_notify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static void cros_usbpd_get_event_and_notify(struct device *dev,
7272

7373
/* Check for PD host events on EC. */
7474
ret = cros_ec_command(ec_dev, EC_CMD_PD_HOST_EVENT_STATUS,
75-
NULL, 0, (uint8_t *)&host_event_status, sizeof(host_event_status));
75+
NULL, 0, &host_event_status, sizeof(host_event_status));
7676
if (ret < 0) {
7777
dev_warn(dev, "Can't get host event status (err: %d)\n", ret);
7878
goto send_notify;

include/linux/platform_data/cros_ec_proto.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ bool cros_ec_check_features(struct cros_ec_dev *ec, int feature);
231231

232232
int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
233233

234-
int cros_ec_command(struct cros_ec_device *ec_dev, int command, uint8_t *outdata, int outsize,
235-
uint8_t *indata, int insize);
234+
int cros_ec_command(struct cros_ec_device *ec_dev, int command, void *outdata, int outsize,
235+
void *indata, int insize);
236236

237237
/**
238238
* cros_ec_get_time_ns() - Return time in ns.

0 commit comments

Comments
 (0)