diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-09 07:27:23 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-09 07:27:23 +0000 |
commit | 83b33810da867c0d9e5741986d82aa9510b0e5bc (patch) | |
tree | faacb8ea91ee8f632aa5595df558cf320e9ab61e | |
parent | bd192fe70eebf1c328376cc22e8ad47562084e95 (diff) | |
download | flashrom-83b33810da867c0d9e5741986d82aa9510b0e5bc.zip flashrom-83b33810da867c0d9e5741986d82aa9510b0e5bc.tar.gz |
Fix Elan SC520 handling
Flashbase is a variable which should never be set outside chipset code.
It is only used to calculate the base address of the flash space at
exactly one location in the code.
Setting flashbase during probe caused subsequent probes to fail unless
special handling code was used. We had such code and it caused every
probe except the first to fail on Elan SC520.
Remove the superfluous flashbase assignment and simplify the rest of the
code.
Corresponding to flashrom svn r488.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
-rw-r--r-- | flashrom.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -113,7 +113,7 @@ struct flashchip *probe_flash(struct flashchip *first_flash, int force) size = getpagesize(); } - base = flashbase && flashchips == first_flash ? flashbase : (0xffffffff - size + 1); + base = flashbase ? flashbase : (0xffffffff - size + 1); flash->virtual_memory = bios = physmap("flash chip", base, size); if (force) @@ -135,7 +135,6 @@ notfound: printf("Found chip \"%s %s\" (%d KB) at physical address 0x%lx.\n", flash->vendor, flash->name, flash->total_size, base); - flashbase = base; return flash; } |