diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/cros_ec.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c index fc0c81ef04ff..c4aecc6f8373 100644 --- a/drivers/mfd/cros_ec.c +++ b/drivers/mfd/cros_ec.c | |||
@@ -74,15 +74,11 @@ int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, | |||
74 | ret = ec_dev->cmd_xfer(ec_dev, msg); | 74 | ret = ec_dev->cmd_xfer(ec_dev, msg); |
75 | if (msg->result == EC_RES_IN_PROGRESS) { | 75 | if (msg->result == EC_RES_IN_PROGRESS) { |
76 | int i; | 76 | int i; |
77 | struct cros_ec_command status_msg; | 77 | struct cros_ec_command status_msg = { }; |
78 | struct ec_response_get_comms_status status; | 78 | struct ec_response_get_comms_status *status; |
79 | 79 | ||
80 | status_msg.version = 0; | ||
81 | status_msg.command = EC_CMD_GET_COMMS_STATUS; | 80 | status_msg.command = EC_CMD_GET_COMMS_STATUS; |
82 | status_msg.outdata = NULL; | 81 | status_msg.insize = sizeof(*status); |
83 | status_msg.outsize = 0; | ||
84 | status_msg.indata = (uint8_t *)&status; | ||
85 | status_msg.insize = sizeof(status); | ||
86 | 82 | ||
87 | /* | 83 | /* |
88 | * Query the EC's status until it's no longer busy or | 84 | * Query the EC's status until it's no longer busy or |
@@ -98,7 +94,10 @@ int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, | |||
98 | msg->result = status_msg.result; | 94 | msg->result = status_msg.result; |
99 | if (status_msg.result != EC_RES_SUCCESS) | 95 | if (status_msg.result != EC_RES_SUCCESS) |
100 | break; | 96 | break; |
101 | if (!(status.flags & EC_COMMS_STATUS_PROCESSING)) | 97 | |
98 | status = (struct ec_response_get_comms_status *) | ||
99 | status_msg.indata; | ||
100 | if (!(status->flags & EC_COMMS_STATUS_PROCESSING)) | ||
102 | break; | 101 | break; |
103 | } | 102 | } |
104 | } | 103 | } |
@@ -119,6 +118,10 @@ static const struct mfd_cell cros_devs[] = { | |||
119 | .id = 2, | 118 | .id = 2, |
120 | .of_compatible = "google,cros-ec-i2c-tunnel", | 119 | .of_compatible = "google,cros-ec-i2c-tunnel", |
121 | }, | 120 | }, |
121 | { | ||
122 | .name = "cros-ec-ctl", | ||
123 | .id = 3, | ||
124 | }, | ||
122 | }; | 125 | }; |
123 | 126 | ||
124 | int cros_ec_register(struct cros_ec_device *ec_dev) | 127 | int cros_ec_register(struct cros_ec_device *ec_dev) |