Private
Public Access
2
0

i2c: fix brackets around if statement

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-12-29 14:41:22 +00:00
parent cc9a4f59b5
commit a65a906e9e

View File

@@ -89,18 +89,20 @@ mraa_i2c_init(int bus)
}
int pos = plat->i2c_bus[bus].sda;
if (plat->pins[pos].i2c.mux_total > 0)
if (plat->pins[pos].i2c.mux_total > 0) {
if (mraa_setup_mux_mapped(plat->pins[pos].i2c) != MRAA_SUCCESS) {
syslog(LOG_ERR, "i2c: Failed to set-up i2c sda multiplexer");
return NULL;
}
}
pos = plat->i2c_bus[bus].scl;
if (plat->pins[pos].i2c.mux_total > 0)
if (plat->pins[pos].i2c.mux_total > 0) {
if (mraa_setup_mux_mapped(plat->pins[pos].i2c) != MRAA_SUCCESS) {
syslog(LOG_ERR, "i2c: Failed to set-up i2c scl multiplexer");
return NULL;
}
}
return mraa_i2c_init_raw((unsigned int) plat->i2c_bus[bus].bus_id);
}