driver: modem: Fix mux device name comparison

CONFIG_UART_MUX_DEVICE_NAME is used as a prefix for the uart muxes
name. Pointer comparison will always return false

Fix #39774

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
This commit is contained in:
Guillaume Lager 2021-10-27 17:41:33 +02:00 committed by Anas Nashif
commit ec0d5b6e8d

View file

@ -130,8 +130,8 @@ static bool mux_is_active(struct modem_iface *iface)
bool active = false; bool active = false;
#if defined(CONFIG_UART_MUX_DEVICE_NAME) #if defined(CONFIG_UART_MUX_DEVICE_NAME)
const char *mux_name = CONFIG_UART_MUX_DEVICE_NAME; active = strncmp(CONFIG_UART_MUX_DEVICE_NAME, iface->dev->name,
active = (mux_name == iface->dev->name); sizeof(CONFIG_UART_MUX_DEVICE_NAME) - 1) == 0;
#endif /* CONFIG_UART_MUX_DEVICE_NAME */ #endif /* CONFIG_UART_MUX_DEVICE_NAME */
return active; return active;