diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2010-06-15 17:04:44 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 14:35:35 -0700 |
commit | e644814a2ccbfe171d2fd2b9bca491ead1ae1a96 (patch) | |
tree | 7610bc54a5e84406c23aef29ac38b2a1ad122e9e /drivers/usb/gadget | |
parent | a5cc8049ca8ec8b09b9649f32b6e37f94345ddb8 (diff) |
usb: throw away custom hex digit methods
Recent kernel has common method to convert hex digit to its value.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/u_ether.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 1da755a1c85..6bb876d6525 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -704,17 +704,6 @@ static char *host_addr; module_param(host_addr, charp, S_IRUGO); MODULE_PARM_DESC(host_addr, "Host Ethernet Address"); - -static u8 __init nibble(unsigned char c) -{ - if (isdigit(c)) - return c - '0'; - c = toupper(c); - if (isxdigit(c)) - return 10 + c - 'A'; - return 0; -} - static int get_ether_addr(const char *str, u8 *dev_addr) { if (str) { @@ -725,8 +714,8 @@ static int get_ether_addr(const char *str, u8 *dev_addr) if ((*str == '.') || (*str == ':')) str++; - num = nibble(*str++) << 4; - num |= (nibble(*str++)); + num = hex_to_bin(*str++) << 4; + num |= hex_to_bin(*str++); dev_addr [i] = num; } if (is_valid_ether_addr(dev_addr)) |