detectflash: preserve errors from lower layers for user to see

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1861 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 14 years ago
parent fd72c20e60
commit 82bf0ed22e

@ -3,6 +3,11 @@
* src/flash/amd_flash.c (urj_flash_amd_detect): Move the bus address range
checks up to before we actually attempt to read/write the bus.
* src/flash/detectflash.c (urj_flash_detectflash): Do not always clobber the
error value when we could not find a flash. If the lower layer logged an
error, then we probably want the user to see that rather than a generic
"flash not found".
2010-09-27 Mike Frysinger <vapier@gentoo.org>
* data/analog/bf533/bf533: Drop brackets from ADDR and DATA signals to match

@ -66,6 +66,8 @@ urj_flash_detectflash (urj_log_level_t ll, urj_bus_t *bus, uint32_t adr)
return URJ_STATUS_FAIL;
}
urj_error_reset ();
urj_flash_cleanup();
URJ_BUS_PREPARE (bus);
@ -94,7 +96,9 @@ urj_flash_detectflash (urj_log_level_t ll, urj_bus_t *bus, uint32_t adr)
if (urj_flash_cfi_array == NULL)
{
urj_error_set (URJ_ERROR_NOTFOUND, _("Flash not found"));
/* Preserve error from lower layers if they set one */
if (urj_error_get () == URJ_ERROR_OK)
urj_error_set (URJ_ERROR_NOTFOUND, _("Flash not found"));
return URJ_STATUS_FAIL;
}

Loading…
Cancel
Save