Skip to content

Commit 345c9c0

Browse files
galaknashif
authored andcommitted
tests: intel_s1000_crb: Convert dma to use DEVICE_DT_GET
Convert how the dma test gets the dma device to use DEVICE_DT_GET and remove use of CONFIG_DMA_0_NAME. Signed-off-by: Kumar Gala <[email protected]>
1 parent bbacab8 commit 345c9c0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/boards/intel_s1000_crb/main/src/dma_test.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ K_SEM_DEFINE(dma_sem, 0, 1);
5757

5858
extern struct k_sem thread_sem;
5959

60-
#define DMA_DEVICE_NAME CONFIG_DMA_0_NAME
6160
#define RX_BUFF_SIZE (48)
6261

6362
struct transfers {
@@ -139,10 +138,10 @@ static int test_task(uint32_t chan_id, uint32_t blen, uint32_t block_count)
139138
return -1;
140139
}
141140

142-
dma_device = device_get_binding(DMA_DEVICE_NAME);
141+
dma_device = DEVICE_DT_GET(DT_NODELABEL(dma0));
143142

144-
if (!dma_device) {
145-
printk("Cannot get dma controller\n");
143+
if (!device_is_ready(dma_device)) {
144+
printk("dma controller is not ready\n");
146145
return -1;
147146
}
148147

0 commit comments

Comments
 (0)