XScale: fewere exit() calls
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 17 Nov 2009 01:55:49 +0000 (17:55 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 17 Nov 2009 01:55:49 +0000 (17:55 -0800)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/xscale.c

index 9e93c020c8a78618b28c5b21d05c19cc6b5d92b8..e97e082c6168bd7c6daa7f9bf1457079cf776a01 100644 (file)
@@ -585,7 +585,7 @@ static int xscale_send(struct target *target, uint8_t *buffer, int count, int si
                        break;
                default:
                        LOG_ERROR("BUG: size neither 4, 2 nor 1");
-                       exit(-1);
+                       return ERROR_INVALID_ARGUMENTS;
                }
                jtag_add_dr_out(target->tap,
                                3,
@@ -850,7 +850,7 @@ static int xscale_arch_state(struct target *target)
        if (armv4_5->common_magic != ARMV4_5_COMMON_MAGIC)
        {
                LOG_ERROR("BUG: called for a non-ARMv4/5 target");
-               exit(-1);
+               return ERROR_INVALID_ARGUMENTS;
        }
 
        LOG_USER("target halted in %s state due to %s, current mode: %s\n"
@@ -1865,8 +1865,8 @@ static int xscale_read_memory(struct target *target, uint32_t address,
                                *buffer++ = buf32[i] & 0xff;
                                break;
                        default:
-                               LOG_ERROR("should never get here");
-                               exit(-1);
+                               LOG_ERROR("invalid read size");
+                               return ERROR_INVALID_ARGUMENTS;
                }
        }