Skip to content

Commit f0a737b

Browse files
bjarki-andreasenPerMac
authored andcommitted
tests: benchmarks: adapt to clock_control_get_rate() removed
The clock_control_get_rate() API is not implemented for all clocks, so it must be conditionally checked. Ref: NRFX-6890 Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 517ada7 commit f0a737b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tests/benchmarks/multicore/idle_clock_control/src/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ static void test_request_release_clock_spec(const struct device *clk_dev,
116116
__ASSERT_NO_MSG(ret == 0);
117117
__ASSERT_NO_MSG(res == 0);
118118
ret = clock_control_get_rate(clk_dev, NULL, &rate);
119-
__ASSERT_NO_MSG(ret == 0);
120-
__ASSERT_NO_MSG(rate == clk_spec->frequency);
119+
if (ret != -ENOSYS) {
120+
__ASSERT_NO_MSG(ret == 0);
121+
__ASSERT_NO_MSG(rate == clk_spec->frequency);
122+
}
121123
k_busy_wait(10000);
122124
ret = nrf_clock_control_release(clk_dev, clk_spec);
123125
__ASSERT_NO_MSG(ret == ONOFF_STATE_ON);

tests/benchmarks/peripheral_load/src/clock_thread.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ static void test_request_release_clock_spec(const struct device *clk_dev,
127127
}
128128
ret = clock_control_get_rate(clk_dev, NULL, &rate);
129129
LOG_INF("Clock control get rate response code: %d", ret);
130-
if (ret != 0) {
130+
if (ret == -ENOSYS) {
131+
LOG_INF("Clock control get rate not supported");
132+
} else if (ret != 0) {
131133
LOG_ERR("Clock control get rate failed");
132134
atomic_inc(&completed_threads);
133135
return;

0 commit comments

Comments
 (0)