From bf1eceeebc4c8b7f4e2431d5bbc5fc8c2ee5a637 Mon Sep 17 00:00:00 2001 From: Piotr Mienkowski Date: Mon, 1 Jun 2020 01:49:47 +0200 Subject: [PATCH] drivers: ublox-sara-r4: update to the new timeout api Update to the new timeout api. This fixes compilation errors. Signed-off-by: Piotr Mienkowski --- drivers/modem/ublox-sara-r4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/modem/ublox-sara-r4.c b/drivers/modem/ublox-sara-r4.c index a205198f2fc..34c545d53fd 100644 --- a/drivers/modem/ublox-sara-r4.c +++ b/drivers/modem/ublox-sara-r4.c @@ -299,7 +299,8 @@ static ssize_t send_socket_data(struct modem_socket *sock, const struct sockaddr *dst_addr, struct modem_cmd *handler_cmds, size_t handler_cmds_len, - const char *buf, size_t buf_len, int timeout) + const char *buf, size_t buf_len, + k_timeout_t timeout) { int ret; char send_buf[sizeof("AT+USO**=#,!###.###.###.###!,#####,####\r\n")]; @@ -351,13 +352,13 @@ static ssize_t send_socket_data(struct modem_socket *sock, k_sleep(MDM_PROMPT_CMD_DELAY); mctx.iface.write(&mctx.iface, buf, buf_len); - if (timeout == K_NO_WAIT) { + if (K_TIMEOUT_EQ(timeout, K_NO_WAIT)) { ret = 0; goto exit; } k_sem_reset(&mdata.sem_response); - ret = k_sem_take(&mdata.sem_response, K_MSEC(timeout)); + ret = k_sem_take(&mdata.sem_response, timeout); if (ret == 0) { ret = modem_cmd_handler_get_error(&mdata.cmd_handler_data);