aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/intel-ish-hid/ishtp-hid-client.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
index 6ce1856bb368..acc2536c8094 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
@@ -412,9 +412,7 @@ void hid_ishtp_get_report(struct hid_device *hid, int report_id,
412{ 412{
413 struct ishtp_hid_data *hid_data = hid->driver_data; 413 struct ishtp_hid_data *hid_data = hid->driver_data;
414 struct ishtp_cl_data *client_data = hid_data->client_data; 414 struct ishtp_cl_data *client_data = hid_data->client_data;
415 static unsigned char buf[10]; 415 struct hostif_msg_to_sensor msg = {};
416 unsigned int len;
417 struct hostif_msg_to_sensor *msg = (struct hostif_msg_to_sensor *)buf;
418 int rv; 416 int rv;
419 int i; 417 int i;
420 418
@@ -426,14 +424,11 @@ void hid_ishtp_get_report(struct hid_device *hid, int report_id,
426 return; 424 return;
427 } 425 }
428 426
429 len = sizeof(struct hostif_msg_to_sensor); 427 msg.hdr.command = (report_type == HID_FEATURE_REPORT) ?
430
431 memset(msg, 0, sizeof(struct hostif_msg_to_sensor));
432 msg->hdr.command = (report_type == HID_FEATURE_REPORT) ?
433 HOSTIF_GET_FEATURE_REPORT : HOSTIF_GET_INPUT_REPORT; 428 HOSTIF_GET_FEATURE_REPORT : HOSTIF_GET_INPUT_REPORT;
434 for (i = 0; i < client_data->num_hid_devices; ++i) { 429 for (i = 0; i < client_data->num_hid_devices; ++i) {
435 if (hid == client_data->hid_sensor_hubs[i]) { 430 if (hid == client_data->hid_sensor_hubs[i]) {
436 msg->hdr.device_id = 431 msg.hdr.device_id =
437 client_data->hid_devices[i].dev_id; 432 client_data->hid_devices[i].dev_id;
438 break; 433 break;
439 } 434 }
@@ -442,8 +437,9 @@ void hid_ishtp_get_report(struct hid_device *hid, int report_id,
442 if (i == client_data->num_hid_devices) 437 if (i == client_data->num_hid_devices)
443 return; 438 return;
444 439
445 msg->report_id = report_id; 440 msg.report_id = report_id;
446 rv = ishtp_cl_send(client_data->hid_ishtp_cl, buf, len); 441 rv = ishtp_cl_send(client_data->hid_ishtp_cl, (uint8_t *)&msg,
442 sizeof(msg));
447 if (rv) 443 if (rv)
448 hid_ishtp_trace(client_data, "%s hid %p send failed\n", 444 hid_ishtp_trace(client_data, "%s hid %p send failed\n",
449 __func__, hid); 445 __func__, hid);