libflashprog: Use newer APIs within flashprog_flash_probe()
We start using the new flashprog_chips_probe() enumeration API.
Handling of multiple chips, i.e. logging their names, is taken
from `cli_classic`. When a chip name is given, we'll skip the
enumeration and call the new flashprog_flash_probe_chip().
Change-Id: I11dea1e8d6973ce8d9565778c25f2196cb98561c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/485
diff --git a/cli_wp.c b/cli_wp.c
index d6c5ed7..c8d7802 100644
--- a/cli_wp.c
+++ b/cli_wp.c
@@ -406,8 +406,7 @@
goto free_ret;
ret = flashprog_flash_probe(&flash, prog, flash_args.chip);
if (ret == 3) {
- fprintf(stderr, "Multiple flash chip definitions match the detected chip.\n"
- "Please specify which chip definition to use with the -c <chipname> option.\n");
+ fprintf(stderr, "Please specify which chip definition to use with the -c <chipname> option.\n");
goto shutdown_ret;
} else if (ret) {
fprintf(stderr, "No EEPROM/flash device found.\n");