diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-11-13 13:44:50 -0800 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-11-13 13:44:50 -0800 |
commit | afe0298399bd06700926822e6d49c5bc44151956 (patch) | |
tree | 55daffc576bd1264222a9602778b1f12d3e7cdfc /src/flash | |
parent | 6435e75e147a6559ed4f784b5e89c8390e787a2a (diff) | |
download | openocd_libswd-afe0298399bd06700926822e6d49c5bc44151956.tar.gz openocd_libswd-afe0298399bd06700926822e6d49c5bc44151956.tar.bz2 openocd_libswd-afe0298399bd06700926822e6d49c5bc44151956.tar.xz openocd_libswd-afe0298399bd06700926822e6d49c5bc44151956.zip |
ARM7/9: rm arm7_9_get_arch_pointers()
Remove the last external user of arm7_9_get_arch_pointers(), and
that annoying downcast utility. Add an is_arm7_9() predicate.
Stop returning specious success codes on various failure paths
in the ARM7/ARM9 commands which used that downcast utility.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/ocl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/flash/ocl.c b/src/flash/ocl.c index 26d28305..0b492c64 100644 --- a/src/flash/ocl.c +++ b/src/flash/ocl.c @@ -46,8 +46,6 @@ static int ocl_protect_check(struct flash_bank *bank) /* flash_bank ocl 0 0 0 0 <target#> */ FLASH_BANK_COMMAND_HANDLER(ocl_flash_bank_command) { - int retval; - struct arm *armv4_5; struct arm7_9_common *arm7_9; struct ocl_priv *ocl; @@ -57,8 +55,9 @@ FLASH_BANK_COMMAND_HANDLER(ocl_flash_bank_command) return ERROR_FLASH_BANK_INVALID; } - if ((retval = arm7_9_get_arch_pointers(bank->target, &armv4_5, &arm7_9)) != ERROR_OK) - return retval; + arm7_9 = target_to_arm7_9(bank->target); + if (!is_arm7_9(arm7_9)) + return ERROR_TARGET_INVALID; ocl = bank->driver_priv = malloc(sizeof(struct ocl_priv)); ocl->jtag_info = &arm7_9->jtag_info; |