[Concept,06/14] ulib: Add a way to obtain the version
Commit Message
From: Simon Glass <sjg@chromium.org>
It is possible to simply read the 'version_string' variable, but it
seems better to add a proper API call to get this. It is already
defined in lib/ulib/ulib.c
Add a prototype to u-boot-lib.h
Make use of it from the demo program.
Fix the comment for ulib_uninit() while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
examples/ulib/demo.c | 2 +-
include/u-boot-lib.h | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
}
demo_show_banner();
- printf("U-Boot version: %s\n", version_string);
+ printf("U-Boot version: %s\n", ulib_get_version());
printf("\n");
/* Use U-Boot's os_open to open a file */
@@ -25,10 +25,17 @@ struct global_data;
int ulib_init(char *progname);
/**
- * ulib_uninit() shut down the U-Boot librrary
+ * ulib_uninit() - shut down the U-Boot library
*
* Call this when your program has finished using the library, before it exits
*/
void ulib_uninit(void);
+/**
+ * ulib_get_version() - Get the version string
+ *
+ * Return: Full U-Boot version string
+ */
+const char *ulib_get_version(void);
+
#endif