summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-01-03 10:32:24 -0500
committerTom Rini <trini@konsulko.com>2016-01-03 10:32:24 -0500
commitf1993ca066100fcaba7d49fecae0ef604e5807e2 (patch)
tree5439c5cdd14b34ff2085b4876472a44349c15843 /drivers/i2c
parentd83c25c318564080ce647795e5ee49133b97e87d (diff)
parentccf4326bac0371774265be0a8b13c150b445e703 (diff)
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/mxc_i2c.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index fa4c82f1a2..b2d15c9b6a 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -581,8 +581,16 @@ void bus_i2c_init(int index, int speed, int unused,
return;
}
- mxc_i2c_buses[index].idle_bus_fn = idle_bus_fn;
- mxc_i2c_buses[index].idle_bus_data = idle_bus_data;
+ /*
+ * Warning: Be careful to allow the assignment to a static
+ * variable here. This function could be called while U-Boot is
+ * still running in flash memory. So such assignment is equal
+ * to write data to flash without erasing.
+ */
+ if (idle_bus_fn)
+ mxc_i2c_buses[index].idle_bus_fn = idle_bus_fn;
+ if (idle_bus_data)
+ mxc_i2c_buses[index].idle_bus_data = idle_bus_data;
ret = enable_i2c_clk(1, index);
if (ret < 0) {