Commit 9e21c7e4 authored by Daniel Walter's avatar Daniel Walter Committed by Ralf Baechle

MIPS: RB532: Replace parse_mac_addr() with mac_pton().

Signed-off-by: default avatarDaniel Walter <dwalter@google.com>
Reviewed-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7150/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 1795cd9b
...@@ -250,28 +250,6 @@ static struct platform_device *rb532_devs[] = { ...@@ -250,28 +250,6 @@ static struct platform_device *rb532_devs[] = {
&rb532_wdt &rb532_wdt
}; };
static void __init parse_mac_addr(char *macstr)
{
int i, h, l;
for (i = 0; i < 6; i++) {
if (i != 5 && *(macstr + 2) != ':')
return;
h = hex_to_bin(*macstr++);
if (h == -1)
return;
l = hex_to_bin(*macstr++);
if (l == -1)
return;
macstr++;
korina_dev0_data.mac[i] = (h << 4) + l;
}
}
/* NAND definitions */ /* NAND definitions */
#define NAND_CHIP_DELAY 25 #define NAND_CHIP_DELAY 25
...@@ -333,7 +311,10 @@ static int __init plat_setup_devices(void) ...@@ -333,7 +311,10 @@ static int __init plat_setup_devices(void)
static int __init setup_kmac(char *s) static int __init setup_kmac(char *s)
{ {
printk(KERN_INFO "korina mac = %s\n", s); printk(KERN_INFO "korina mac = %s\n", s);
parse_mac_addr(s); if (!mac_pton(s, korina_dev0_data.mac)) {
printk(KERN_ERR "Invalid mac\n");
return -EINVAL;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment