aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2011-07-16 16:32:50 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-08-10 06:52:09 +0200
commit5f698273c21ae969177c83fe094de9c7f0b83bf1 (patch)
treef8e3971869eef56b97475e71265f10b0e3521977
parent5812ef2b73db2f513f9c42d6cf4b695268d04d69 (diff)
rlink: remove duplicated code
After the reply_index handling is fixed, there's no need to special case the out scan. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
-rw-r--r--src/jtag/drivers/rlink.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/jtag/drivers/rlink.c b/src/jtag/drivers/rlink.c
index d0b18b1b..4b2e5428 100644
--- a/src/jtag/drivers/rlink.c
+++ b/src/jtag/drivers/rlink.c
@@ -688,26 +688,16 @@ dtc_queue_run(void) {
dtc_queue.cmd_buffer[dtc_queue.cmd_index++] = DTC_CMD_STOP;
- /* run the cmd */
- if (dtc_queue.rq_head == NULL) {
- usb_err = dtc_run_download(pHDev,
- dtc_queue.cmd_buffer, dtc_queue.cmd_index,
- NULL, 0
- );
- if (usb_err < 0) {
- LOG_ERROR("dtc_run_download: %s", usb_strerror());
- exit(1);
- }
- } else {
- usb_err = dtc_run_download(pHDev,
- dtc_queue.cmd_buffer, dtc_queue.cmd_index,
- reply_buffer, dtc_queue.reply_index
- );
- if (usb_err < 0) {
- LOG_ERROR("dtc_run_download: %s", usb_strerror());
- exit(1);
- }
+ usb_err = dtc_run_download(pHDev,
+ dtc_queue.cmd_buffer, dtc_queue.cmd_index,
+ reply_buffer, dtc_queue.reply_index
+ );
+ if (usb_err < 0) {
+ LOG_ERROR("dtc_run_download: %s", usb_strerror());
+ exit(1);
+ }
+ if (dtc_queue.rq_head != NULL) {
/* process the reply, which empties the reply queue and frees its entries */
dtc_p = reply_buffer;