Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[firefly-linux-kernel-4.4.55.git] / arch / mips / rb532 / devices.c
index 3af00b2a26ee97a7b98cfd95f8704e97e3383734..e31e8cdcb296bfadc9c6ab2f394e089b4f48ad4b 100644 (file)
@@ -223,6 +223,7 @@ static struct platform_device rb532_wdt = {
 
 static struct plat_serial8250_port rb532_uart_res[] = {
        {
+               .type           = PORT_16550A,
                .membase        = (char *)KSEG1ADDR(REGBASE + UART0BASE),
                .irq            = UART0_IRQ,
                .regshift       = 2,
@@ -250,28 +251,6 @@ static struct platform_device *rb532_devs[] = {
        &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 */
 #define NAND_CHIP_DELAY 25
 
@@ -333,7 +312,10 @@ static int __init plat_setup_devices(void)
 static int __init setup_kmac(char *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;
 }