diff options
author | Daniel Walter <dwalter@google.com> | 2014-06-24 11:39:59 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-02 07:54:22 -0400 |
commit | 5db7ccdc9f685fd742cc32efe58aa0c036f380b9 (patch) | |
tree | f80e816c80aa0fd8f7381de1eb457bd529c266ec /arch/mips/ar7 | |
parent | 1f8d271385d542796ab7917692908beef10acdc9 (diff) |
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.c | 5 |
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) | |||
307 | } | 307 | } |
308 | 308 | ||
309 | if (mac) { | 309 | if (mac) { |
310 | if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", | 310 | if (!mac_pton(mac, dev_addr)) { |
311 | &dev_addr[0], &dev_addr[1], | ||
312 | &dev_addr[2], &dev_addr[3], | ||
313 | &dev_addr[4], &dev_addr[5]) != 6) { | ||
314 | pr_warn("cannot parse mac address, using random address\n"); | 311 | pr_warn("cannot parse mac address, using random address\n"); |
315 | eth_random_addr(dev_addr); | 312 | eth_random_addr(dev_addr); |
316 | } | 313 | } |