public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [patch] do not use cmd_reset uninitialized in cfi_flash.c
@ 2008-01-29  3:27 Mike Frysinger
  2008-01-29  6:15 ` Stefan Roese
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Frysinger @ 2008-01-29  3:27 UTC (permalink / raw)
  To: u-boot

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 <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
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++) {

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

end of thread, other threads:[~2008-02-20  9:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29  3:27 [U-Boot-Users] [patch] do not use cmd_reset uninitialized in cfi_flash.c Mike Frysinger
2008-01-29  6:15 ` Stefan Roese
2008-01-29 13:05   ` Mike Frysinger
2008-01-29 13:13     ` Stefan Roese
2008-02-03 15:56       ` Michael Schwingen
2008-02-04 10:13         ` Stefan Roese
2008-02-04 15:48           ` Michael Schwingen
2008-02-04 16:05             ` Stefan Roese
2008-02-05  9:45               ` Michael Schwingen
2008-02-05  9:52                 ` Stefan Roese
2008-02-18 22:16               ` Michael Schwingen
2008-02-20  9:18                 ` Stefan Roese
2008-02-20  9:50                   ` Haavard Skinnemoen

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