From: Srinivas Kandagatla Date: Fri, 11 Dec 2015 16:28:18 +0000 (+0000) Subject: uart.c: make use of no_bus_mux flag X-Git-Tag: v0.9.0~70 X-Git-Url: http://review.tizen.org/git/?p=contrib%2Fmraa.git;a=commitdiff_plain;h=38aa9e8fe624fd1be33a8aa7091db24ecc672609 uart.c: make use of no_bus_mux flag This patch makes use of no_bus_mux flag in mraa_board_t to skip unnessary mux checks. Signed-off-by: Srinivas Kandagatla Signed-off-by: Brendan Le Foll --- diff --git a/src/uart/uart.c b/src/uart/uart.c index 5fc0cc1..499af93 100644 --- a/src/uart/uart.c +++ b/src/uart/uart.c @@ -152,22 +152,24 @@ mraa_uart_init(int index) return NULL; } - int pos = plat->uart_dev[index].rx; - if (pos >= 0) { - if (plat->pins[pos].uart.mux_total > 0) { - if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) { - syslog(LOG_ERR, "uart: failed to setup muxes for RX pin"); - return NULL; + if (!plat->no_bus_mux) { + int pos = plat->uart_dev[index].rx; + if (pos >= 0) { + if (plat->pins[pos].uart.mux_total > 0) { + if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) { + syslog(LOG_ERR, "uart: failed to setup muxes for RX pin"); + return NULL; + } } } - } - pos = plat->uart_dev[index].tx; - if (pos >= 0) { - if (plat->pins[pos].uart.mux_total > 0) { - if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) { - syslog(LOG_ERR, "uart: failed to setup muxes for TX pin"); - return NULL; + pos = plat->uart_dev[index].tx; + if (pos >= 0) { + if (plat->pins[pos].uart.mux_total > 0) { + if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) { + syslog(LOG_ERR, "uart: failed to setup muxes for TX pin"); + return NULL; + } } } }