aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch')
-rw-r--r--target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch15
1 files changed, 6 insertions, 9 deletions
diff --git a/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch b/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch
index eac7933884..377f16e7c9 100644
--- a/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch
+++ b/target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch
@@ -1,19 +1,16 @@
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
-@@ -132,6 +132,33 @@ static void *of_get_mac_address_mtd(stru
- return NULL;
+@@ -132,6 +132,30 @@ static void *of_get_mac_address_mtd(stru
+ return -EINVAL;
}
+static int of_add_mac_address(struct device_node *np, u8* addr)
+{
+ struct property *prop;
-+ u8 *np_addr;
+
-+ np_addr = of_get_mac_addr(np, "mac-address");
-+ if (np_addr) {
-+ memcpy(np_addr, addr, ETH_ALEN);
-+ return 0;
-+ }
++ prop = of_find_property(np, "mac-address", NULL);
++ if (prop)
++ kfree(prop);
+
+ prop = kzalloc(sizeof(*prop), GFP_KERNEL);
+ if (!prop)
@@ -39,6 +36,6 @@
addr[inc_idx] += mac_inc;
+ of_add_mac_address(np, addr);
- return addr;
+ return ret;
}
EXPORT_SYMBOL(of_get_mac_address);