We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8f7246 commit 5d05d2eCopy full SHA for 5d05d2e
tests/drivers/can/timing/src/main.c
@@ -22,9 +22,7 @@
22
* @}
23
*/
24
25
-#define CAN_DEVICE_NAME DT_LABEL(DT_CHOSEN(zephyr_canbus))
26
-
27
-const struct device *can_dev;
+const struct device *can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
28
29
struct timing_samples {
30
uint32_t bitrate;
@@ -124,8 +122,7 @@ static void test_verify_algo(void)
124
122
125
123
void test_main(void)
126
{
127
- can_dev = device_get_binding(CAN_DEVICE_NAME);
128
- zassert_not_null(can_dev, "Device not found");
+ zassert_true(device_is_ready(can_dev), "CAN device not ready");
129
130
ztest_test_suite(can_timing,
131
ztest_unit_test(test_verify_algo));
0 commit comments