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 <srinivas.kandagatla@linaro.org> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
5e0c6d3807
commit
38aa9e8fe6
@@ -152,22 +152,24 @@ mraa_uart_init(int index)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pos = plat->uart_dev[index].rx;
|
if (!plat->no_bus_mux) {
|
||||||
if (pos >= 0) {
|
int pos = plat->uart_dev[index].rx;
|
||||||
if (plat->pins[pos].uart.mux_total > 0) {
|
if (pos >= 0) {
|
||||||
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) {
|
if (plat->pins[pos].uart.mux_total > 0) {
|
||||||
syslog(LOG_ERR, "uart: failed to setup muxes for RX pin");
|
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) {
|
||||||
return NULL;
|
syslog(LOG_ERR, "uart: failed to setup muxes for RX pin");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pos = plat->uart_dev[index].tx;
|
pos = plat->uart_dev[index].tx;
|
||||||
if (pos >= 0) {
|
if (pos >= 0) {
|
||||||
if (plat->pins[pos].uart.mux_total > 0) {
|
if (plat->pins[pos].uart.mux_total > 0) {
|
||||||
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) {
|
if (mraa_setup_mux_mapped(plat->pins[pos].uart) != MRAA_SUCCESS) {
|
||||||
syslog(LOG_ERR, "uart: failed to setup muxes for TX pin");
|
syslog(LOG_ERR, "uart: failed to setup muxes for TX pin");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user