X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=common%2Fcmd_otp.c;h=593bb8c650ca18fdb5418884d3941d0191021f83;hb=f09d4f4f75c5b179c77679416421552b309b7f97;hp=6f933355176296ac2541d0b45960dfbef87bb27d;hpb=5c877b1ae0a4219ed6bd8d32cf3f7106b81ecb3b;p=karo-tx-uboot.git diff --git a/common/cmd_otp.c b/common/cmd_otp.c index 6f93335517..593bb8c650 100644 --- a/common/cmd_otp.c +++ b/common/cmd_otp.c @@ -18,6 +18,7 @@ #include #include +#include #include static const char *otp_strerror(uint32_t err) @@ -157,21 +158,9 @@ int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) lowup(half + count - 1), page + (half + count - 1) / 2, half + count ); - - i = 0; - while (1) { - if (tstc()) { - const char exp_ans[] = "YES\r"; - char c; - putc(c = getc()); - if (exp_ans[i++] != c) { - printf(" Aborting\n"); - return 1; - } else if (!exp_ans[i]) { - puts("\n"); - break; - } - } + if (!confirm_yesno()) { + printf(" Aborting\n"); + return 1; } }