Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
30765436 0dcde508

+1 -15
+1 -15
drivers/staging/rtl8712/usb_intf.c
··· 353 353 } 354 354 } 355 355 356 - static u8 key_2char2num(u8 hch, u8 lch) 357 - { 358 - return (hex_to_bin(hch) << 4) | hex_to_bin(lch); 359 - } 360 - 361 356 /* 362 357 * drv_init() - a device potentially for us 363 358 * ··· 460 465 r8712_efuse_pg_packet_read(padapter, offset, 461 466 &pdata[i]); 462 467 463 - if (r8712_initmac) { 464 - /* Users specify the mac address */ 465 - int jj, kk; 466 - 467 - for (jj = 0, kk = 0; jj < ETH_ALEN; 468 - jj++, kk += 3) 469 - mac[jj] = 470 - key_2char2num(r8712_initmac[kk], 471 - r8712_initmac[kk + 1]); 472 - } else { 468 + if (!r8712_initmac || !mac_pton(r8712_initmac, mac)) { 473 469 /* Use the mac address stored in the Efuse 474 470 * offset = 0x12 for usb in efuse 475 471 */