i2c: fix brackets around if statement
authorBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 29 Dec 2014 14:41:22 +0000 (14:41 +0000)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 5 Jan 2015 14:38:50 +0000 (14:38 +0000)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/i2c/i2c.c

index da9da0d..2386827 100644 (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);
 }