Skip to content

Commit 989e17a

Browse files
committed
dma: HDA: Convert to DEVICE_DT_GET
Move to using DEVICE_DT_GET so we can phase out DT_LABEL. Signed-off-by: Kumar Gala <[email protected]>
1 parent 5c16ba0 commit 989e17a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

subsys/logging/log_backend_cavs_hda.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ void cavs_hda_log_init(cavs_hda_log_hook_t fn, uint32_t channel)
248248

249249
int res;
250250

251-
hda_log_dev = device_get_binding("HDA_HOST_IN");
252-
__ASSERT(hda_log_dev, "No valid DMA device found");
251+
hda_log_dev = DEVICE_DT_GET(DT_NODELABEL(hda_host_in));
252+
__ASSERT(device_is_ready(hda_log_dev), "DMA device is not ready");
253253

254254
hda_log_chan = dma_request_channel(hda_log_dev, &channel);
255255
__ASSERT(hda_log_chan >= 0, "No valid DMA channel");

tests/boards/intel_adsp/hda/src/dma.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ void test_hda_host_in_dma(void)
6767
z_xtensa_cache_flush(dma_buf, DMA_BUF_SIZE);
6868
#endif
6969

70-
dma = device_get_binding("HDA_HOST_IN");
71-
zassert_not_null(dma, "Expected a valid DMA device pointer");
70+
dma = DEVICE_DT_GET(DT_NODELABEL(hda_host_in));
71+
zassert_true(device_is_ready(dma), "DMA device is not ready");
7272

7373
channel = dma_request_channel(dma, NULL);
7474
zassert_true(channel >= 0, "Expected a valid DMA channel");
@@ -159,8 +159,8 @@ void test_hda_host_out_dma(void)
159159

160160
printk("Using buffer of size %d at addr %p\n", DMA_BUF_SIZE, dma_buf);
161161

162-
dma = device_get_binding("HDA_HOST_OUT");
163-
zassert_not_null(dma, "Expected a valid DMA device pointer");
162+
dma = DEVICE_DT_GET(DT_NODELABEL(hda_host_out));
163+
zassert_true(device_is_ready(dma), "DMA device is not ready");
164164

165165
channel = dma_request_channel(dma, NULL);
166166
zassert_true(channel >= 0, "Expected a valid DMA channel");

0 commit comments

Comments
 (0)