Skip to content

Commit

Permalink
kernel: drop support for mtd-mac-address
Browse files Browse the repository at this point in the history
Now that we have fully switched to nvmem interface we can drop
the use of mtd-mac-address patches as it's not used anymore and
the new nvmem implementation should be used for any new device.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel authored and adschm committed Oct 9, 2021
1 parent 46646ef commit 5ae2e78
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 228 deletions.

This file was deleted.

Expand Up @@ -20,9 +20,9 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>

--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -166,31 +166,56 @@ static int of_get_mac_address_mtd(struct
* If a mtd-mac-address property exists, try to fetch the MAC address from the
* specified mtd device.
@@ -115,27 +115,52 @@ static int of_get_mac_addr_nvmem(struct
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
* but is all zeros.
*
+ * DT can tell the system to increment the mac-address after is extracted by
+ * using:
Expand Down Expand Up @@ -63,11 +63,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
ret = of_get_mac_addr(np, "address", addr);
if (!ret)
- return 0;
+ goto found;

ret = of_get_mac_address_mtd(np, addr);
if (!ret)
- return 0;
+ goto found;
+
+ ret = of_get_mac_addr_nvmem(np, addr);
Expand Down
@@ -1,7 +1,7 @@
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -141,6 +141,26 @@ static int of_get_mac_address_mtd(struct
return -EINVAL;
@@ -95,6 +95,27 @@ static int of_get_mac_addr_nvmem(struct
return 0;
}

+static int of_add_mac_address(struct device_node *np, u8* addr)
Expand All @@ -24,10 +24,11 @@
+ kfree(prop);
+ return -ENOMEM;
+}
+
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
@@ -216,6 +236,7 @@ found:
* checked first, because that is supposed to contain to "most recent" MAC
@@ -161,6 +182,7 @@ found:
if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
addr[inc_idx] += mac_inc;

Expand Down

This file was deleted.

Expand Up @@ -20,9 +20,9 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>

--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -160,31 +160,56 @@ static int of_get_mac_address_mtd(struct
* If a mtd-mac-address property exists, try to fetch the MAC address from the
* specified mtd device.
@@ -109,27 +109,52 @@ static int of_get_mac_addr_nvmem(struct
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
* but is all zeros.
*
+ * DT can tell the system to increment the mac-address after is extracted by
+ * using:
Expand Down Expand Up @@ -63,11 +63,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
ret = of_get_mac_addr(np, "address", addr);
if (!ret)
- return 0;
+ goto found;

ret = of_get_mac_address_mtd(np, addr);
if (!ret)
- return 0;
+ goto found;
+
+ ret = of_get_mac_addr_nvmem(np, addr);
Expand Down
@@ -1,7 +1,7 @@
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -135,6 +135,26 @@ static int of_get_mac_address_mtd(struct
return -EINVAL;
@@ -89,6 +89,27 @@ static int of_get_mac_addr_nvmem(struct
return 0;
}

+static int of_add_mac_address(struct device_node *np, u8* addr)
Expand All @@ -24,10 +24,11 @@
+ kfree(prop);
+ return -ENOMEM;
+}
+
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
@@ -210,6 +230,7 @@ found:
* checked first, because that is supposed to contain to "most recent" MAC
@@ -155,6 +176,7 @@ found:
if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
addr[inc_idx] += mac_inc;

Expand Down

0 comments on commit 5ae2e78

Please sign in to comment.