net: pasemi: Replace mac address parsing
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 19 Dec 2017 18:31:03 +0000 (20:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Dec 2017 17:47:46 +0000 (12:47 -0500)
Replace sscanf() with mac_pton().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pasemi/pasemi_mac.c

index c9a55b774935cd8900435e308c441d2283e5cb39..07a2eb3781b12a307b71849e38d8cbcb6edf1a1e 100644 (file)
@@ -212,9 +212,7 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
                return -ENOENT;
        }
 
-       if (sscanf(maddr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
-                  &addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5])
-           != ETH_ALEN) {
+       if (!mac_pton(maddr, addr)) {
                dev_warn(&pdev->dev,
                         "can't parse mac address, not configuring\n");
                return -EINVAL;