platform/chrome: cros_ec_proto: don't show MKBP version if unsupported

[ Upstream commit b36f0643ff ]

It wrongly showed the following message when it doesn't support MKBP:
"MKBP support version 4294967295".

Fix it.

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220609084957.3684698-14-tzungbi@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Tzung-Bi Shih 2022-06-09 08:49:49 +00:00 коммит произвёл Greg Kroah-Hartman
Родитель da56759a4a
Коммит 08c0a77b2a
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -507,13 +507,13 @@ int cros_ec_query_all(struct cros_ec_device *ec_dev)
ret = cros_ec_get_host_command_version_mask(ec_dev,
EC_CMD_GET_NEXT_EVENT,
&ver_mask);
if (ret < 0 || ver_mask == 0)
if (ret < 0 || ver_mask == 0) {
ec_dev->mkbp_event_supported = 0;
else
} else {
ec_dev->mkbp_event_supported = fls(ver_mask);
dev_dbg(ec_dev->dev, "MKBP support version %u\n",
ec_dev->mkbp_event_supported - 1);
dev_dbg(ec_dev->dev, "MKBP support version %u\n", ec_dev->mkbp_event_supported - 1);
}
/* Probe if host sleep v1 is supported for S0ix failure detection. */
ret = cros_ec_get_host_command_version_mask(ec_dev,