summaryrefslogtreecommitdiff
path: root/jedec.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-01-09 02:24:17 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-01-09 02:24:17 +0000
commitb0c292c8c92529d7865ceddb0431c5902981c8a5 (patch)
tree522479a7a1cd5669f763de7e6b86aa7a93c60986 /jedec.c
parent45277558a9b35cfbc9f50d31f3aa2a2661873910 (diff)
downloadflashrom-b0c292c8c92529d7865ceddb0431c5902981c8a5.tar.gz
Use the register mapping feature bit.
All functions which just call probe_jedec and then map flash registers are replaced by probe_jedec. All functions which call probe_jedec, map flash registers and do something else can at least eliminate mapping flash registers. Fix logic inversion in probe_jedec to map flash registers on success instead of on failure. Change a few TIMING_IGNORED to TIMING_FIXME where probe_jedec is used. Total savings: One probe function simplified, three probe functions eliminated. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Sean Nelson <audiohacked@gmail.com> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@839 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'jedec.c')
-rw-r--r--jedec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/jedec.c b/jedec.c
index e1bd12f..3a21539 100644
--- a/jedec.c
+++ b/jedec.c
@@ -189,13 +189,13 @@ int probe_jedec_common(struct flashchip *flash,
printf_debug(", id2 is normal flash content");
printf_debug("\n");
- if (largeid1 == flash->manufacture_id && largeid2 == flash->model_id)
- return 1;
+ if (largeid1 != flash->manufacture_id || largeid2 != flash->model_id)
+ return 0;
if (flash->feature_bits & FEATURE_REGISTERMAP)
map_flash_registers(flash);
- return 0;
+ return 1;
}
int erase_sector_jedec_common(struct flashchip *flash, unsigned int page,