44 *
55 * SPDX-License-Identifier: Apache-2.0
66 */
7+ #define DT_DRV_COMPAT gsm_ppp
78
89#include <logging/log.h>
910LOG_MODULE_REGISTER (modem_gsm , CONFIG_MODEM_LOG_LEVEL );
@@ -29,6 +30,8 @@ LOG_MODULE_REGISTER(modem_gsm, CONFIG_MODEM_LOG_LEVEL);
2930#include <time.h>
3031#endif
3132
33+ #define GSM_UART_DEV_ID DT_INST_BUS(0)
34+ #define GSM_UART_DEV_NAME DT_INST_BUS_LABEL(0)
3235#define GSM_CMD_READ_BUF 128
3336#define GSM_CMD_AT_TIMEOUT K_SECONDS(2)
3437#define GSM_CMD_SETUP_TIMEOUT K_SECONDS(6)
@@ -1067,7 +1070,7 @@ static void mux_setup(struct k_work *work)
10671070{
10681071 struct gsm_modem * gsm = CONTAINER_OF (work , struct gsm_modem ,
10691072 gsm_configure_work );
1070- const struct device * uart = device_get_binding ( CONFIG_MODEM_GSM_UART_NAME );
1073+ const struct device * uart = DEVICE_DT_GET ( GSM_UART_DEV_ID );
10711074 int ret ;
10721075
10731076 /* We need to call this to reactivate mux ISR. Note: This is only called
@@ -1226,7 +1229,7 @@ void gsm_ppp_start(const struct device *dev)
12261229
12271230 /* Re-init underlying UART comms */
12281231 int r = modem_iface_uart_init_dev (& gsm -> context .iface ,
1229- device_get_binding ( CONFIG_MODEM_GSM_UART_NAME ));
1232+ DEVICE_DT_GET ( GSM_UART_DEV_ID ));
12301233 if (r ) {
12311234 LOG_ERR ("modem_iface_uart_init returned %d" , r );
12321235 return ;
@@ -1303,7 +1306,7 @@ static int gsm_init(const struct device *dev)
13031306 gsm -> gsm_data .rx_rb_buf_len = sizeof (gsm -> gsm_rx_rb_buf );
13041307
13051308 r = modem_iface_uart_init (& gsm -> context .iface , & gsm -> gsm_data ,
1306- device_get_binding ( CONFIG_MODEM_GSM_UART_NAME ));
1309+ DEVICE_DT_GET ( GSM_UART_DEV_ID ));
13071310 if (r < 0 ) {
13081311 LOG_DBG ("iface uart error %d" , r );
13091312 return r ;
0 commit comments