summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-11-14 22:57:20 +0300
committerTom Rini <trini@konsulko.com>2019-12-03 02:23:09 +0300
commit2189d5f1e8a2fd74ce52906999fd50c8f8330c81 (patch)
tree5d9f8f4af8b10404c6137b4c3dc88b07ce4bf8cc /include
parent8bef79bf3c30cd1fc5367cc1f78f72e6552629e9 (diff)
downloadu-boot-2189d5f1e8a2fd74ce52906999fd50c8f8330c81.tar.xz
Move strtomhz() to vsprintf.h
At present this function sits in its own file but it does not really justify it. There are similar string functions in vsprintf.h, so move it there. Also add the missing function comment. Use the vsprintf.h include file explicitly where needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/common.h3
-rw-r--r--include/vsprintf.h10
2 files changed, 10 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h
index d17a2b2642..f993e4bef3 100644
--- a/include/common.h
+++ b/include/common.h
@@ -310,9 +310,6 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
/* lib/vsprintf.c */
#include <vsprintf.h>
-/* lib/strmhz.c */
-char * strmhz(char *buf, unsigned long hz);
-
/*
* STDIO based functions (can always be used)
*/
diff --git a/include/vsprintf.h b/include/vsprintf.h
index d1740a378e..56844dd2de 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -212,4 +212,14 @@ void print_grouped_ull(unsigned long long int_val, int digits);
bool str2off(const char *p, loff_t *num);
bool str2long(const char *p, ulong *num);
+
+/**
+ * strmhz() - Convert a value to a Hz string
+ *
+ * This creates a string indicating the number of MHz of a value. For example,
+ * 2700000 produces "2.7".
+ * @buf: Buffer to hold output string, which must be large enough
+ * @hz: Value to convert
+ */
+char *strmhz(char *buf, unsigned long hz);
#endif