summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Goodbody <[email protected]>2025-11-21 17:34:32 +0000
committerTom Rini <[email protected]>2025-12-05 17:03:31 -0600
commitfe780310cfa8bf5a093894b5cd7fe85c6b02fd91 (patch)
tree0f6758b72f8e8aa90260ee4ea19d724d84fe8baf /test
parent1c0a46e2918a1ddf42f51449e45077513dd52417 (diff)
clk: Return value calculated by ERR_PTR
In clk_set_default_get_by_id ret is passed to ERR_PTR but nothing is done with the value that this calculates which is obviously not the intention of the code. This is confirmed by the code around where this function is called. Instead return the value from ERR_PTR. Then fixup the sandbox code so that the test dm_test_clk does not fail as it relied on the broken behaviour. Finally disable part of the test that does not work correctly with CLK_AUTO_ID This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/dm/clk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/dm/clk.c b/test/dm/clk.c
index 790968e6477..c3363796498 100644
--- a/test/dm/clk.c
+++ b/test/dm/clk.c
@@ -89,8 +89,9 @@ static int dm_test_clk(struct unit_test_state *uts)
SANDBOX_CLK_TEST_ID_SPI));
ut_asserteq(0, sandbox_clk_test_get_rate(dev_test,
SANDBOX_CLK_TEST_ID_I2C));
- ut_asserteq(321, sandbox_clk_test_get_rate(dev_test,
- SANDBOX_CLK_TEST_ID_DEVM1));
+ if (!CONFIG_IS_ENABLED(CLK_AUTO_ID))
+ ut_asserteq(321, sandbox_clk_test_get_rate(dev_test,
+ SANDBOX_CLK_TEST_ID_DEVM1));
ut_asserteq(0, sandbox_clk_test_get_rate(dev_test,
SANDBOX_CLK_TEST_ID_DEVM2));