diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2010-07-22 23:18:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-23 15:50:50 -0400 |
commit | 5c4ac8c60aba4b2e9549d139586612855b0fea09 (patch) | |
tree | 67d3c357fc2a51403e9485b2d4c027bde70e274d /drivers/net/ksz884x.c | |
parent | 2b27822ff8f257f810761c3d23e8104d1404cf3b (diff) |
drivers: net: use newly introduced hex_to_bin()
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ksz884x.c')
-rw-r--r-- | drivers/net/ksz884x.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c index b3c010b85658..8b32cc107f0f 100644 --- a/drivers/net/ksz884x.c +++ b/drivers/net/ksz884x.c | |||
@@ -6894,13 +6894,12 @@ static void get_mac_addr(struct dev_info *hw_priv, u8 *macaddr, int port) | |||
6894 | i = j = num = got_num = 0; | 6894 | i = j = num = got_num = 0; |
6895 | while (j < MAC_ADDR_LEN) { | 6895 | while (j < MAC_ADDR_LEN) { |
6896 | if (macaddr[i]) { | 6896 | if (macaddr[i]) { |
6897 | int digit; | ||
6898 | |||
6897 | got_num = 1; | 6899 | got_num = 1; |
6898 | if ('0' <= macaddr[i] && macaddr[i] <= '9') | 6900 | digit = hex_to_bin(macaddr[i]); |
6899 | num = num * 16 + macaddr[i] - '0'; | 6901 | if (digit >= 0) |
6900 | else if ('A' <= macaddr[i] && macaddr[i] <= 'F') | 6902 | num = num * 16 + digit; |
6901 | num = num * 16 + 10 + macaddr[i] - 'A'; | ||
6902 | else if ('a' <= macaddr[i] && macaddr[i] <= 'f') | ||
6903 | num = num * 16 + 10 + macaddr[i] - 'a'; | ||
6904 | else if (':' == macaddr[i]) | 6903 | else if (':' == macaddr[i]) |
6905 | got_num = 2; | 6904 | got_num = 2; |
6906 | else | 6905 | else |