Commit e410b4ad authored by Tzung-Bi Shih's avatar Tzung-Bi Shih

platform/chrome: kunit: initialize lock for fake ec_dev

cros_ec_cmd_xfer() uses ec_dev->lock.  Initialize it.

Otherwise, dmesg shows the following:
> DEBUG_LOCKS_WARN_ON(lock->magic != lock)
> ...
> Call Trace:
>  ? __mutex_lock
>  ? __warn
>  ? __mutex_lock
>  ...
>  ? cros_ec_cmd_xfer
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20231003080504.4011337-1-tzungbi@kernel.orgSigned-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
parent a7bad167
......@@ -2668,6 +2668,7 @@ static int cros_ec_proto_test_init(struct kunit *test)
ec_dev->dev->release = cros_ec_proto_test_release;
ec_dev->cmd_xfer = cros_kunit_ec_xfer_mock;
ec_dev->pkt_xfer = cros_kunit_ec_xfer_mock;
mutex_init(&ec_dev->lock);
priv->msg = (struct cros_ec_command *)priv->_msg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment