]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
platform/chrome: cros_ec_proto: change Kunit expectation when timed out
authorTzung-Bi Shih <tzungbi@kernel.org>
Mon, 18 Jul 2022 05:09:11 +0000 (05:09 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Wed, 20 Jul 2022 01:22:58 +0000 (01:22 +0000)
While EC_COMMS_STATUS_PROCESSING flag is still on after it tries
EC_COMMAND_RETRIES times for sending EC_CMD_GET_COMMS_STATUS,
cros_ec_wait_until_complete() doesn't return an error code.

Change the expectation to an error code.

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

index 64100fd81c6aded230c9ac957fe71dcf9440d507..fbb872040711b2c85888087a62a1d7085d6e59df 100644 (file)
@@ -1870,9 +1870,7 @@ static void cros_ec_proto_test_cmd_xfer_in_progress_retries_status_processing(st
        }
 
        ret = cros_ec_cmd_xfer(ec_dev, &msg);
-       KUNIT_EXPECT_EQ(test, ret, sizeof(struct ec_response_get_comms_status));
-
-       KUNIT_EXPECT_EQ(test, msg.result, EC_RES_SUCCESS);
+       KUNIT_EXPECT_EQ(test, ret, -EAGAIN);
 
        /* For EC_CMD_GET_COMMS_STATUS EC_COMMAND_RETRIES times. */
        KUNIT_EXPECT_EQ(test, cros_kunit_ec_pkt_xfer_mock_called, 51);