drivers: isdn: use new hex_to_bin() method
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Mon, 24 May 2010 21:33:25 +0000 (14:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 May 2010 15:07:05 +0000 (08:07 -0700)
Remove own implementation of hex_to_bin().

Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Acked-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/isdn/gigaset/capi.c

index 964a55fb148608b57f99b30db5b2c859654e7cf6..ac4cfeed3946bc6e1010c15ab47c7084887ef8ec 100644 (file)
@@ -169,17 +169,6 @@ static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
                         msgname, paramname);
 }
 
-/*
- * convert hex to binary
- */
-static inline u8 hex2bin(char c)
-{
-       int result = c & 0x0f;
-       if (c & 0x40)
-               result += 9;
-       return result;
-}
-
 /*
  * convert an IE from Gigaset hex string to ETSI binary representation
  * including length byte
@@ -191,7 +180,7 @@ static int encode_ie(char *in, u8 *out, int maxlen)
        while (*in) {
                if (!isxdigit(in[0]) || !isxdigit(in[1]) || l >= maxlen)
                        return -1;
-               out[++l] = (hex2bin(in[0]) << 4) + hex2bin(in[1]);
+               out[++l] = (hex_to_bin(in[0]) << 4) + hex_to_bin(in[1]);
                in += 2;
        }
        out[0] = l;