aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/cros_ec_proto_test.c
diff options
context:
space:
mode:
authorTzung-Bi Shih <[email protected]>2022-06-09 08:49:46 +0000
committerTzung-Bi Shih <[email protected]>2022-06-10 02:31:43 +0000
commita88f79666d14836215058f38e2ac4f1fea61a53e (patch)
tree2e1f89286e87bba78bedd60c37f94e9c97c4cb8c /drivers/platform/chrome/cros_ec_proto_test.c
parent878c36f6caa45d6a6234465fb16da07fc639f51d (diff)
platform/chrome: cros_ec_proto: separate cros_ec_get_proto_info_legacy()
Rename cros_ec_host_command_proto_query_v2() to cros_ec_get_proto_info_legacy() and make it responsible for setting `ec_dev` fields for EC protocol v2. Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/platform/chrome/cros_ec_proto_test.c')
-rw-r--r--drivers/platform/chrome/cros_ec_proto_test.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c
index 1378ac90e1cb..8e47cb70dc8b 100644
--- a/drivers/platform/chrome/cros_ec_proto_test.c
+++ b/drivers/platform/chrome/cros_ec_proto_test.c
@@ -485,7 +485,7 @@ static void cros_ec_proto_test_query_all_legacy_normal_v3_return_error(struct ku
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
struct ec_response_hello *data;
@@ -512,7 +512,7 @@ static void cros_ec_proto_test_query_all_legacy_normal_v3_return_error(struct ku
KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
struct ec_params_hello *data;
@@ -550,7 +550,7 @@ static void cros_ec_proto_test_query_all_legacy_normal_v3_return0(struct kunit *
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
struct ec_response_hello *data;
@@ -577,7 +577,7 @@ static void cros_ec_proto_test_query_all_legacy_normal_v3_return0(struct kunit *
KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
struct ec_params_hello *data;
@@ -615,7 +615,7 @@ static void cros_ec_proto_test_query_all_legacy_xfer_error(struct kunit *test)
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
mock = cros_kunit_ec_xfer_mock_addx(test, -EIO, EC_RES_SUCCESS, 0);
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
@@ -638,7 +638,7 @@ static void cros_ec_proto_test_query_all_legacy_xfer_error(struct kunit *test)
KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
mock = cros_kunit_ec_xfer_mock_next();
KUNIT_EXPECT_PTR_NE(test, mock, NULL);
@@ -663,7 +663,7 @@ static void cros_ec_proto_test_query_all_legacy_return_error(struct kunit *test)
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
mock = cros_kunit_ec_xfer_mock_addx(test, 0, EC_RES_INVALID_COMMAND, 0);
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
@@ -671,7 +671,7 @@ static void cros_ec_proto_test_query_all_legacy_return_error(struct kunit *test)
cros_ec_proto_test_query_all_pretest(test);
ret = cros_ec_query_all(ec_dev);
- KUNIT_EXPECT_EQ(test, ret, EC_RES_INVALID_COMMAND);
+ KUNIT_EXPECT_EQ(test, ret, -EOPNOTSUPP);
KUNIT_EXPECT_EQ(test, ec_dev->proto_version, EC_PROTO_VERSION_UNKNOWN);
/* For cros_ec_get_proto_info() without passthru. */
@@ -686,7 +686,7 @@ static void cros_ec_proto_test_query_all_legacy_return_error(struct kunit *test)
KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
mock = cros_kunit_ec_xfer_mock_next();
KUNIT_EXPECT_PTR_NE(test, mock, NULL);
@@ -711,7 +711,7 @@ static void cros_ec_proto_test_query_all_legacy_data_error(struct kunit *test)
KUNIT_ASSERT_PTR_NE(test, mock, NULL);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
struct ec_response_hello *data;
@@ -739,7 +739,7 @@ static void cros_ec_proto_test_query_all_legacy_data_error(struct kunit *test)
KUNIT_EXPECT_EQ(test, mock->msg.outsize, 0);
}
- /* For cros_ec_host_command_proto_query_v2(). */
+ /* For cros_ec_get_proto_info_legacy(). */
{
mock = cros_kunit_ec_xfer_mock_next();
KUNIT_EXPECT_PTR_NE(test, mock, NULL);