summaryrefslogtreecommitdiff
path: root/src/flash/nor
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-09-28 15:37:56 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-09-29 08:43:27 +0200
commit3a693ef526575633cc350a69aa1a5d1f08e64c46 (patch)
tree6af64277137ac59254bf20d7d3ca175728a709bd /src/flash/nor
parentecad76061f6edff5db67ad05e6514dff6cd6efc7 (diff)
downloadopenocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.tar.gz
openocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.tar.bz2
openocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.tar.xz
openocd+libswd-3a693ef526575633cc350a69aa1a5d1f08e64c46.zip
fileio: refactor struct fileio to be an opaque structure
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/flash/nor')
-rw-r--r--src/flash/nor/tcl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index 8604b4b3..f36ab7da 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -604,9 +604,9 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
return ERROR_OK;
}
- buffer = malloc(fileio.size);
+ buffer = malloc(fileio_size(&fileio));
size_t buf_cnt;
- if (fileio_read(&fileio, fileio.size, buffer, &buf_cnt) != ERROR_OK)
+ if (fileio_read(&fileio, fileio_size(&fileio), buffer, &buf_cnt) != ERROR_OK)
{
free(buffer);
fileio_close(&fileio);
@@ -622,8 +622,8 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
{
command_print(CMD_CTX, "wrote %ld bytes from file %s to flash bank %u"
" at offset 0x%8.8" PRIx32 " in %fs (%0.3f KiB/s)",
- (long)fileio.size, CMD_ARGV[1], p->bank_number, offset,
- duration_elapsed(&bench), duration_kbps(&bench, fileio.size));
+ (long)fileio_size(&fileio), CMD_ARGV[1], p->bank_number, offset,
+ duration_elapsed(&bench), duration_kbps(&bench, fileio_size(&fileio)));
}
fileio_close(&fileio);