Created
October 28, 2020 18:21
-
-
Save damex/010880e0ecf08a432551e115acc6eed1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/drivers/staging/octeon/ethernet.c | |
+++ b/drivers/staging/octeon/ethernet.c | |
@@ -407,9 +407,12 @@ | |
{ | |
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); | |
+ label = of_get_property(priv->of_node, "label", NULL); | |
+ } | |
if (!IS_ERR_OR_NULL(mac)) | |
ether_addr_copy(dev->dev_addr, mac); | |
@@ -444,6 +447,9 @@ | |
if (dev->netdev_ops->ndo_stop) | |
dev->netdev_ops->ndo_stop(dev); | |
+ if (!IS_ERR_OR_NULL(label)) | |
+ dev_change_name(dev, label); | |
+ | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment