Skip to content

Commit 6c9c7ec

Browse files
galaknashif
authored andcommitted
i2s: atmel sam ssc: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access to the dma controller device. Signed-off-by: Kumar Gala <[email protected]>
1 parent aeac33a commit 6c9c7ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/i2s/i2s_sam_ssc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,9 +929,8 @@ static int i2s_sam_initialize(const struct device *dev)
929929
k_sem_init(&dev_data->tx.sem, CONFIG_I2S_SAM_SSC_TX_BLOCK_COUNT,
930930
CONFIG_I2S_SAM_SSC_TX_BLOCK_COUNT);
931931

932-
dev_data->dev_dma = device_get_binding(DT_INST_DMAS_LABEL_BY_NAME(0, tx));
933-
if (!dev_data->dev_dma) {
934-
LOG_ERR("%s device not found", DT_INST_DMAS_LABEL_BY_NAME(0, tx));
932+
if (!device_is_ready(dev_data->dev_dma)) {
933+
LOG_ERR("%s device not ready", dev_data->dev_dma->name);
935934
return -ENODEV;
936935
}
937936

@@ -988,6 +987,7 @@ struct queue_item rx_0_ring_buf[CONFIG_I2S_SAM_SSC_RX_BLOCK_COUNT + 1];
988987
struct queue_item tx_0_ring_buf[CONFIG_I2S_SAM_SSC_TX_BLOCK_COUNT + 1];
989988

990989
static struct i2s_sam_dev_data i2s0_sam_data = {
990+
.dev_dma = DEVICE_DT_GET(DT_INST_DMAS_CTLR_BY_NAME(0, tx)),
991991
.rx = {
992992
.dma_channel = DT_INST_DMAS_CELL_BY_NAME(0, rx, channel),
993993
.dma_cfg = {

0 commit comments

Comments
 (0)