aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/usb_intf.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2013-09-13 17:59:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 07:47:46 -0700
commit30765436fd3fdd797cfb67dd232b37fc855bb751 (patch)
treebfb658dc1a3f320cb63799eb1b6df453343d4448 /drivers/staging/rtl8712/usb_intf.c
parentstaging: dwc2: Fix typo in staging/dwc2 (diff)
downloadlinux-dev-30765436fd3fdd797cfb67dd232b37fc855bb751.tar.xz
linux-dev-30765436fd3fdd797cfb67dd232b37fc855bb751.zip
staging: rtl8712: re-use native mac_pton() helper
There is a nice helper to parse MAC. Let's use it and remove custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/usb_intf.c')
-rw-r--r--drivers/staging/rtl8712/usb_intf.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index c812d6c7dc31..dbefa43e4c2c 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -353,11 +353,6 @@ static void disable_ht_for_spec_devid(const struct usb_device_id *pdid,
}
}
-static u8 key_2char2num(u8 hch, u8 lch)
-{
- return (hex_to_bin(hch) << 4) | hex_to_bin(lch);
-}
-
/*
* drv_init() - a device potentially for us
*
@@ -465,16 +460,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
r8712_efuse_pg_packet_read(padapter, offset,
&pdata[i]);
- if (r8712_initmac) {
- /* Users specify the mac address */
- int jj, kk;
-
- for (jj = 0, kk = 0; jj < ETH_ALEN;
- jj++, kk += 3)
- mac[jj] =
- key_2char2num(r8712_initmac[kk],
- r8712_initmac[kk + 1]);
- } else {
+ if (!r8712_initmac || !mac_pton(r8712_initmac, mac)) {
/* Use the mac address stored in the Efuse
* offset = 0x12 for usb in efuse
*/