diff options
| author | Vignesh R <[email protected]> | 2016-07-25 16:26:45 +0530 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2016-08-08 13:33:00 -0400 |
| commit | 95def3cf5d24aebbcdffe6c4fc1a39288cf00b6a (patch) | |
| tree | 5da7983c36c96d4411c17842e532ad2b887e378c | |
| parent | 0812d1a094c402db4fc25ca988113a6d6663c70f (diff) | |
i2c: i2c-uclass-compat: avoid any BSS usage
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 <[email protected]>
Acked-by: Heiko Schocher<[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | drivers/i2c/i2c-uclass-compat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-uclass-compat.c b/drivers/i2c/i2c-uclass-compat.c index 5606d1f807f..de78db6a887 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) |
