summaryrefslogtreecommitdiff
path: root/src/flash/nor/core.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2011-01-03 13:30:28 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-01-03 13:33:27 +0100
commitc69553cbc51770f61cf3b9225d46d058fa2544d0 (patch)
tree07aa7f6d5bc1861cc926e2359034ef42f17dc46a /src/flash/nor/core.c
parent1795239cfda77315ea2f4fbc028e7a411d13a7d0 (diff)
downloadopenocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.tar.gz
openocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.tar.bz2
openocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.tar.xz
openocd+libswd-c69553cbc51770f61cf3b9225d46d058fa2544d0.zip
error handling: the error number is not part of the user interface
Do not propagate error number to user. This is for internal programming purposes only. Error messages to the user is reported as text via LOG_ERROR(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/flash/nor/core.c')
-rw-r--r--src/flash/nor/core.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c
index ff467d3d..2c3b2f82 100644
--- a/src/flash/nor/core.c
+++ b/src/flash/nor/core.c
@@ -46,7 +46,7 @@ int flash_driver_erase(struct flash_bank *bank, int first, int last)
retval = bank->driver->erase(bank, first, last);
if (retval != ERROR_OK)
{
- LOG_ERROR("failed erasing sectors %d to %d (%d)", first, last, retval);
+ LOG_ERROR("failed erasing sectors %d to %d", first, last);
}
return retval;
@@ -80,7 +80,7 @@ int flash_driver_protect(struct flash_bank *bank, int set, int first, int last)
retval = bank->driver->protect(bank, set, first, last);
if (retval != ERROR_OK)
{
- LOG_ERROR("failed setting protection for areas %d to %d (%d)", first, last, retval);
+ LOG_ERROR("failed setting protection for areas %d to %d", first, last);
}
return retval;
@@ -94,8 +94,8 @@ int flash_driver_write(struct flash_bank *bank,
retval = bank->driver->write(bank, buffer, offset, count);
if (retval != ERROR_OK)
{
- LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)",
- bank->base, offset, retval);
+ LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32,
+ bank->base, offset);
}
return retval;
@@ -111,8 +111,8 @@ int flash_driver_read(struct flash_bank *bank,
retval = bank->driver->read(bank, buffer, offset, count);
if (retval != ERROR_OK)
{
- LOG_ERROR("error reading to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)",
- bank->base, offset, retval);
+ LOG_ERROR("error reading to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32,
+ bank->base, offset);
}
return retval;
@@ -209,7 +209,7 @@ int get_flash_bank_by_name(const char *name, struct flash_bank **bank_result)
if (retval != ERROR_OK)
{
- LOG_ERROR("auto_probe failed %d\n", retval);
+ LOG_ERROR("auto_probe failed\n");
return retval;
}
}
@@ -232,7 +232,7 @@ int get_flash_bank_by_num(int num, struct flash_bank **bank)
if (retval != ERROR_OK)
{
- LOG_ERROR("auto_probe failed %d\n", retval);
+ LOG_ERROR("auto_probe failed\n");
return retval;
}
*bank = p;
@@ -253,7 +253,7 @@ int get_flash_bank_by_addr(struct target *target, uint32_t addr, bool check, str
if (retval != ERROR_OK)
{
- LOG_ERROR("auto_probe failed %d\n", retval);
+ LOG_ERROR("auto_probe failed\n");
return retval;
}
/* check whether address belongs to this flash bank */