summaryrefslogtreecommitdiff
path: root/arch/mips/ar7
diff options
context:
space:
mode:
authorDaniel Walter <dwalter@google.com>2014-06-24 19:39:59 +0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-02 14:54:22 +0300
commit5db7ccdc9f685fd742cc32efe58aa0c036f380b9 (patch)
treef80e816c80aa0fd8f7381de1eb457bd529c266ec /arch/mips/ar7
parent1f8d271385d542796ab7917692908beef10acdc9 (diff)
downloadlinux-5db7ccdc9f685fd742cc32efe58aa0c036f380b9.tar.xz
MIPS: AR7: Replace mac address parsing
Replace sscanf() with mac_pton(). [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Daniel Walter <dwalter@google.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7151/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ar7')
-rw-r--r--arch/mips/ar7/platform.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index af2441dbfc12..be9ff1673ded 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -307,10 +307,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
}
if (mac) {
- if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
- &dev_addr[0], &dev_addr[1],
- &dev_addr[2], &dev_addr[3],
- &dev_addr[4], &dev_addr[5]) != 6) {
+ if (!mac_pton(mac, dev_addr)) {
pr_warn("cannot parse mac address, using random address\n");
eth_random_addr(dev_addr);
}