unsigned int ctrl_num)
{
unsigned int i;
- char buffer[HWCONFIG_BUFFER_SIZE];
- char *buf = NULL;
+ char buf[HWCONFIG_BUFFER_SIZE];
#if defined(CONFIG_SYS_FSL_DDR3) || \
defined(CONFIG_SYS_FSL_DDR2) || \
defined(CONFIG_SYS_FSL_DDR4)
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
- if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
- buf = buffer;
+ if (env_get_f("hwconfig", buf, sizeof(buf)) < 0)
+ buf[0] = '\0';
#if defined(CONFIG_SYS_FSL_DDR3) || \
defined(CONFIG_SYS_FSL_DDR2) || \
int use_spd = 0;
#ifdef CONFIG_DDR_SPD
- char buffer[HWCONFIG_BUFFER_SIZE];
- char *buf = NULL;
+ char buf[HWCONFIG_BUFFER_SIZE];
/*
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
- if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
- buf = buffer;
+ if (env_get_f("hwconfig", buf, sizeof(buf)) < 0)
+ buf[0] = '\0';
/* if hwconfig is not enabled, or "sdram" is not defined, use spd */
if (hwconfig_sub_f("fsl_ddr", "sdram", buf)) {