public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage
@ 2016-07-25 10:56 Vignesh R
  2016-07-26  6:23 ` Heiko Schocher
  2016-08-10  0:45 ` [U-Boot] [U-Boot, RFC] " Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Vignesh R @ 2016-07-25 10:56 UTC (permalink / raw)
  To: u-boot

As I2C can be used before DRAM initialization for reading EEPROM,
avoid using static variables stored in BSS, since BSS is in DRAM, which
may not have been initialised yet. Explicitly mark "static global"
variables as belonging to the .data section.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 drivers/i2c/i2c-uclass-compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-uclass-compat.c b/drivers/i2c/i2c-uclass-compat.c
index 5606d1f807f6..de78db6a887f 100644
--- a/drivers/i2c/i2c-uclass-compat.c
+++ b/drivers/i2c/i2c-uclass-compat.c
@@ -9,7 +9,7 @@
 #include <errno.h>
 #include <i2c.h>
 
-static int cur_busnum;
+static int cur_busnum __attribute__((section(".data")));
 
 static int i2c_compat_get_device(uint chip_addr, int alen,
 				 struct udevice **devp)
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-08-10  0:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 10:56 [U-Boot] [RFC PATCH] i2c: i2c-uclass-compat: avoid any BSS usage Vignesh R
2016-07-26  6:23 ` Heiko Schocher
2016-07-28  5:54   ` Vignesh R
2016-07-29  3:37     ` Heiko Schocher
2016-08-01  1:03       ` Simon Glass
2016-08-10  0:45 ` [U-Boot] [U-Boot, RFC] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox