summaryrefslogtreecommitdiff
path: root/src/flash/nand.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-18 05:36:18 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-18 15:51:07 -0800
commit410fab9ea8c6632da2e4967d960f66eecc7821ec (patch)
tree51f6d5146aa04bc13ea8809963f31d03b71fd3bc /src/flash/nand.c
parent75a37eb5b37386768327e9670acfedc7811d529f (diff)
downloadopenocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.gz
openocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.bz2
openocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.xz
openocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.zip
use COMMAND_PARSE_ENABLE macro where appropriate
Updates all command parsing of simple "enable" and "disable" arguments. A few case in the tree use a tri-state or extended arguments, which cannot use this simple macro. Simlifies the xscale icache/dcache command handler logic.
Diffstat (limited to 'src/flash/nand.c')
-rw-r--r--src/flash/nand.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/flash/nand.c b/src/flash/nand.c
index c96354aa..23caed0d 100644
--- a/src/flash/nand.c
+++ b/src/flash/nand.c
@@ -1663,14 +1663,7 @@ COMMAND_HANDLER(handle_nand_raw_access_command)
}
if (CMD_ARGC == 2)
- {
- if (strcmp("enable", CMD_ARGV[1]) == 0)
- p->use_raw = 1;
- else if (strcmp("disable", CMD_ARGV[1]) == 0)
- p->use_raw = 0;
- else
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
+ COMMAND_PARSE_ENABLE(CMD_ARGV[1], p->use_raw);
const char *msg = p->use_raw ? "enabled" : "disabled";
command_print(CMD_CTX, "raw access is %s", msg);