ALSA: alsa: riptide: don't use own hex_to_bin() method
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Tue, 15 Jun 2010 14:26:28 +0000 (17:26 +0300)
committerTakashi Iwai <tiwai@suse.de>
Thu, 17 Jun 2010 07:34:58 +0000 (09:34 +0200)
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/riptide/riptide.c

index ad44626776153019a4a491351c472fba25765908..59d79962f2367e3a98cc9fc4db47c65576a6ff79 100644 (file)
@@ -97,6 +97,7 @@
 #include <linux/gameport.h>
 #include <linux/device.h>
 #include <linux/firmware.h>
+#include <linux/kernel.h>
 #include <asm/io.h>
 #include <sound/core.h>
 #include <sound/info.h>
@@ -667,13 +668,12 @@ static u32 atoh(const unsigned char *in, unsigned int len)
        unsigned char c;
 
        while (len) {
+               int value;
+
                c = in[len - 1];
-               if ((c >= '0') && (c <= '9'))
-                       sum += mult * (c - '0');
-               else if ((c >= 'A') && (c <= 'F'))
-                       sum += mult * (c - ('A' - 10));
-               else if ((c >= 'a') && (c <= 'f'))
-                       sum += mult * (c - ('a' - 10));
+               value = hex_to_bin(c);
+               if (value >= 0)
+                       sum += mult * value;
                mult *= 16;
                --len;
        }