treewide: backport support for nvmem on non platform devices
[openwrt/staging/wigyori.git] / target / linux / octeon / patches-5.4 / 700-allocate_interface_by_label.patch
index 3a9b2eb7cd032907067fabf060be4ef67aef5730..4ee6f8466099faaf29bf4a08158a3d870c9b50ac 100644 (file)
@@ -12,20 +12,18 @@ Tested-by: Johannes Kimmel <fff@bareminimum.eu>
 Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
 --- a/drivers/staging/octeon/ethernet.c
 +++ b/drivers/staging/octeon/ethernet.c
-@@ -408,9 +408,12 @@ int cvm_oct_common_init(struct net_devic
+@@ -408,7 +408,11 @@ int cvm_oct_common_init(struct net_devic
+ int cvm_oct_common_init(struct net_device *dev)
  {
        struct octeon_ethernet *priv = netdev_priv(dev);
-       const u8 *mac = NULL;
 +      const u8 *label = NULL;
--      if (priv->of_node)
-+      if (priv->of_node) {
-               mac = of_get_mac_address(priv->of_node);
+       int ret;
++
++      if (priv->of_node)
 +              label = of_get_property(priv->of_node, "label", NULL);
-+      }
  
-       if (!IS_ERR_OR_NULL(mac))
-               ether_addr_copy(dev->dev_addr, mac);
+       ret = of_get_mac_address(priv->of_node, dev->dev_addr);
+       if (ret)
 @@ -445,6 +448,9 @@ int cvm_oct_common_init(struct net_devic
        if (dev->netdev_ops->ndo_stop)
                dev->netdev_ops->ndo_stop(dev);