From 87d308708712ff6075c4dd54b0519b47fdad8816 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Thu, 26 Mar 2020 12:44:27 +0200 Subject: Backports v5.4.27 Backports generated by toradex backports f6e8852f1ef28e6d3c9bae8400eb6a87a6b0c3e7 against mainline kernel tag v5.4.27 Signed-off-by: Oleksandr Suvorov --- compat/backport-3.2.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 compat/backport-3.2.c (limited to 'compat/backport-3.2.c') diff --git a/compat/backport-3.2.c b/compat/backport-3.2.c new file mode 100644 index 0000000..601a168 --- /dev/null +++ b/compat/backport-3.2.c @@ -0,0 +1,25 @@ +/* + * Linux backport symbols for kernels 3.2. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include + +int hex2bin(u8 *dst, const char *src, size_t count) +{ + while (count--) { + int hi = hex_to_bin(*src++); + int lo = hex_to_bin(*src++); + + if ((hi < 0) || (lo < 0)) + return -1; + + *dst++ = (hi << 4) | lo; + } + return 0; +} +EXPORT_SYMBOL_GPL(hex2bin); -- cgit v1.2.3