staging: octeon-ethernet: support of_get_mac_address new ERR_PTR error
authorPetr Štetiar <ynezz@true.cz>
Fri, 3 May 2019 14:27:13 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 May 2019 04:47:07 +0000 (21:47 -0700)
There was NVMEM support added to of_get_mac_address, so it could now return
ERR_PTR encoded error values, so we need to adjust all current users of
of_get_mac_address to this new fact.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/staging/octeon/ethernet.c

index 986db76705ccc6b5d384f2db08f715739936d942..2b0301821d7b81b9fb0c33ab3e85ab677524ae7a 100644 (file)
@@ -421,7 +421,7 @@ int cvm_oct_common_init(struct net_device *dev)
        if (priv->of_node)
                mac = of_get_mac_address(priv->of_node);
 
-       if (mac)
+       if (!IS_ERR(mac))
                ether_addr_copy(dev->dev_addr, mac);
        else
                eth_hw_addr_random(dev);