From 33dc2a250d2847aca16c11e25c5ac2dcf4519f3c Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Tue, 6 Nov 2007 17:59:47 +0000 Subject: [PATCH] [ 1281432 ] Update jedec.c of patch #835292 to current environment git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@683 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/libbrux/flash/jedec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jtag/libbrux/flash/jedec.c b/jtag/libbrux/flash/jedec.c index 14c12278..1687a464 100644 --- a/jtag/libbrux/flash/jedec.c +++ b/jtag/libbrux/flash/jedec.c @@ -314,6 +314,7 @@ jedec_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array ) int ba, bw; int i, j; cfi_query_structure_t *cfi; + bus_area_t area; *cfi_array = calloc( 1, sizeof (cfi_array_t) ); if (!*cfi_array) @@ -321,7 +322,9 @@ jedec_detect( bus_t *bus, uint32_t adr, cfi_array_t **cfi_array ) (*cfi_array)->bus = bus; (*cfi_array)->address = adr; - bw = bus_width( bus, adr ); + if (bus_area( bus, adr, &area ) != 0) + return -8; /* bus width detection failed */ + bw = area.width; if (bw != 8 && bw != 16 && bw != 32) return -3; /* invalid bus width */ (*cfi_array)->bus_width = ba = bw / 8;