From: Mike Frysinger Date: Mon, 28 Jan 2008 22:27:05 -0500 Subject: [U-Boot-Users] [patch] do not use cmd_reset uninitialized in cfi_flash.c Message-ID: <200801282227.06426.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The cmd_reset member of the flash info struct is not initialized until the specific cmdset function is called. This normally happens by: flash_get_size -> flash_detect_cfi -> cmdset_*_init That means we cannot use cmd_reset inside of the cfi detection functions. Signed-off-by: Sonic Zhang Signed-off-by: Mike Frysinger --- diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index eb509f5..eb3f517 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1538,7 +1538,7 @@ { int cfi_offset; - flash_write_cmd (info, 0, 0, info->cmd_reset); + flash_write_cmd (info, 0, 0, FLASH_CMD_RESET); for (cfi_offset=0; cfi_offset < sizeof(flash_offset_cfi) / sizeof(uint); cfi_offset++) {