From 18d66533ac773f59efc93e5c19971fad5e6af82f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 10 Apr 2014 20:01:25 -0600 Subject: move CLI prototypes to cli.h and add comments Move the CLI prototypes from common.h to cli.h as part of an effort to reduce the size of common.h. Signed-off-by: Simon Glass --- board/hymod/hymod.c | 1 + board/hymod/input.c | 1 + 2 files changed, 2 insertions(+) (limited to 'board/hymod') diff --git a/board/hymod/hymod.c b/board/hymod/hymod.c index 5fec914..ea49e26 100644 --- a/board/hymod/hymod.c +++ b/board/hymod/hymod.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/board/hymod/input.c b/board/hymod/input.c index 184902c..23d3f19 100644 --- a/board/hymod/input.c +++ b/board/hymod/input.c @@ -6,6 +6,7 @@ */ #include +#include int hymod_get_serno (const char *prompt) -- cgit v1.1 From e1bf824dfd6881f6f633238c275bfa1e5d83c433 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 10 Apr 2014 20:01:27 -0600 Subject: Add cli_ prefix to readline functions This makes it clear where the code resides. Signed-off-by: Simon Glass --- board/hymod/hymod.c | 2 +- board/hymod/input.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'board/hymod') diff --git a/board/hymod/hymod.c b/board/hymod/hymod.c index ea49e26..55ffd67 100644 --- a/board/hymod/hymod.c +++ b/board/hymod/hymod.c @@ -416,7 +416,7 @@ last_stage_init (void) #ifdef CONFIG_BOOT_RETRY_TIME /* - * we use the readline () function, but we also want + * we use the cli_readline() function, but we also want * command timeout enabled */ init_cmd_timeout (); diff --git a/board/hymod/input.c b/board/hymod/input.c index 23d3f19..59ad6aa 100644 --- a/board/hymod/input.c +++ b/board/hymod/input.c @@ -19,7 +19,7 @@ hymod_get_serno (const char *prompt) reset_cmd_timeout (); #endif - n = readline (prompt); + n = cli_readline(prompt); if (n < 0) return (n); @@ -47,7 +47,7 @@ hymod_get_ethaddr (void) reset_cmd_timeout (); #endif - n = readline ("Enter board ethernet address: "); + n = cli_readline("Enter board ethernet address: "); if (n < 0) return (n); -- cgit v1.1 From 0098e179e1afacb3cf595c67a98b8739dc7edcde Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 10 Apr 2014 20:01:30 -0600 Subject: Move bootretry code into bootretry.c and clean up This code is only used by one board, so it seems a shame to clutter up the readline code with it. Move it into its own file. Signed-off-by: Simon Glass --- board/hymod/hymod.c | 1 + board/hymod/input.c | 1 + 2 files changed, 2 insertions(+) (limited to 'board/hymod') diff --git a/board/hymod/hymod.c b/board/hymod/hymod.c index 55ffd67..f6990e9 100644 --- a/board/hymod/hymod.c +++ b/board/hymod/hymod.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include diff --git a/board/hymod/input.c b/board/hymod/input.c index 59ad6aa..2f857c0 100644 --- a/board/hymod/input.c +++ b/board/hymod/input.c @@ -6,6 +6,7 @@ */ #include +#include #include int -- cgit v1.1 From b26440f1fa243396000536028ea00e5e185b6b6a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 10 Apr 2014 20:01:31 -0600 Subject: Rename bootretry functions and remove #ifdefs Add a bootretry_ prefix to these two functions, and remove the need for the #ifdef around everything (it moves to the Makefile). Signed-off-by: Simon Glass --- board/hymod/hymod.c | 4 +--- board/hymod/input.c | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'board/hymod') diff --git a/board/hymod/hymod.c b/board/hymod/hymod.c index f6990e9..0183f78 100644 --- a/board/hymod/hymod.c +++ b/board/hymod/hymod.c @@ -415,13 +415,11 @@ last_stage_init (void) hymod_conf_t *cp = &gd->bd->bi_hymod_conf; int rc; -#ifdef CONFIG_BOOT_RETRY_TIME /* * we use the cli_readline() function, but we also want * command timeout enabled */ - init_cmd_timeout (); -#endif + bootretry_init_cmd_timeout(); memset ((void *) cp, 0, sizeof (*cp)); diff --git a/board/hymod/input.c b/board/hymod/input.c index 2f857c0..a9035d3 100644 --- a/board/hymod/input.c +++ b/board/hymod/input.c @@ -16,9 +16,7 @@ hymod_get_serno (const char *prompt) int n, serno; char *p; -#ifdef CONFIG_BOOT_RETRY_TIME - reset_cmd_timeout (); -#endif + bootretry_reset_cmd_timeout(); n = cli_readline(prompt); @@ -44,9 +42,7 @@ hymod_get_ethaddr (void) for (;;) { int n; -#ifdef CONFIG_BOOT_RETRY_TIME - reset_cmd_timeout (); -#endif + bootretry_reset_cmd_timeout(); n = cli_readline("Enter board ethernet address: "); -- cgit v1.1