platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()
authorTzung-Bi Shih <tzungbi@kernel.org>
Thu, 9 Jun 2022 08:49:43 +0000 (08:49 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Fri, 10 Jun 2022 02:31:43 +0000 (02:31 +0000)
commitb4d0836e81603600a8db7777b588fe020abf4cf8
tree3195dbade7fc51b432f235f4376f93f663668cce
parent93bea2faed630bd014916fd2e7ab16a79ee1b46a
platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info()

Rename cros_ec_host_command_proto_query() to cros_ec_get_proto_info()
and make it responsible for setting `ec_dev` fields according to the
response protocol info.

Also make cros_ec_get_host_event_wake_mask() allocate its own message
buffer.  It was lucky that size of `struct ec_response_host_event_mask`
is less than `struct ec_response_get_protocol_info`.  Thus, the buffer
wasn't overflow.

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220609084957.3684698-8-tzungbi@kernel.org
drivers/platform/chrome/cros_ec_proto.c
drivers/platform/chrome/cros_ec_proto_test.c