aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2021-07-29 08:45:24 +0200
committerDavid Bauer <mail@david-bauer.net>2021-07-29 08:51:08 +0200
commit9928236d16291cb7a7d40265454b6a23e9e03e7f (patch)
treeff8fe985b0bba04bc71aecd12721896960a3e637
parentcd39aba402ea7e7a11e173b0b5aa96e42bf1f2ac (diff)
downloadupstream-9928236d16291cb7a7d40265454b6a23e9e03e7f.tar.gz
upstream-9928236d16291cb7a7d40265454b6a23e9e03e7f.tar.bz2
upstream-9928236d16291cb7a7d40265454b6a23e9e03e7f.zip
generic: fix compile-error for non-mtd platforms
Fixes commit cd39aba402ea ("generic: write back netdev MAC-address to device-tree") Signed-off-by: David Bauer <mail@david-bauer.net>
-rw-r--r--target/linux/generic/pending-5.10/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch7
-rw-r--r--target/linux/generic/pending-5.10/682-of_net-add-mac-address-increment-support.patch2
-rw-r--r--target/linux/generic/pending-5.10/683-of_net-add-mac-address-to-of-tree.patch6
-rw-r--r--target/linux/generic/pending-5.4/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch7
-rw-r--r--target/linux/generic/pending-5.4/682-of_net-add-mac-address-increment-support.patch2
-rw-r--r--target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch6
6 files changed, 16 insertions, 14 deletions
diff --git a/target/linux/generic/pending-5.10/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch b/target/linux/generic/pending-5.10/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch
index 7d2267eb29..cc5cd96ead 100644
--- a/target/linux/generic/pending-5.10/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch
+++ b/target/linux/generic/pending-5.10/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch
@@ -34,7 +34,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
{
struct property *pp = of_find_property(np, name, NULL);
-@@ -78,6 +79,55 @@ static const void *of_get_mac_addr_nvmem
+@@ -78,6 +79,56 @@ static const void *of_get_mac_addr_nvmem
return mac;
}
@@ -84,13 +84,14 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
+
+ return addr;
+#endif
++ return NULL;
+}
+
+
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
* checked first, because that is supposed to contain to "most recent" MAC
-@@ -98,6 +148,10 @@ static const void *of_get_mac_addr_nvmem
+@@ -98,6 +149,10 @@ static const void *of_get_mac_addr_nvmem
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
* but is all zeros.
*
@@ -101,7 +102,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* Return: Will be a valid pointer on success and ERR_PTR in case of error.
*/
const void *of_get_mac_address(struct device_node *np)
-@@ -116,6 +170,10 @@ const void *of_get_mac_address(struct de
+@@ -116,6 +171,10 @@ const void *of_get_mac_address(struct de
if (addr)
return addr;
diff --git a/target/linux/generic/pending-5.10/682-of_net-add-mac-address-increment-support.patch b/target/linux/generic/pending-5.10/682-of_net-add-mac-address-increment-support.patch
index 9032b9186c..2a72c7c94e 100644
--- a/target/linux/generic/pending-5.10/682-of_net-add-mac-address-increment-support.patch
+++ b/target/linux/generic/pending-5.10/682-of_net-add-mac-address-increment-support.patch
@@ -65,7 +65,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
{
#ifdef CONFIG_MTD
struct platform_device *pdev = of_find_device_by_node(np);
-@@ -152,28 +157,54 @@ static const void *of_get_mac_address_mt
+@@ -153,28 +158,54 @@ static const void *of_get_mac_address_mt
* If a mtd-mac-address property exists, try to fetch the MAC address from the
* specified mtd device.
*
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 3e331bac63..5d1f05af7f 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,7 +1,7 @@
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
-@@ -132,6 +132,33 @@ static void *of_get_mac_address_mtd(stru
- #endif
+@@ -133,6 +133,33 @@ static void *of_get_mac_address_mtd(stru
+ return NULL;
}
+static int of_add_mac_address(struct device_node *np, u8* addr)
@@ -34,7 +34,7 @@
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
-@@ -205,6 +232,7 @@ found:
+@@ -206,6 +233,7 @@ found:
if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
addr[inc_idx] += mac_inc;
diff --git a/target/linux/generic/pending-5.4/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch b/target/linux/generic/pending-5.4/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch
index b6ac24abcd..a890501933 100644
--- a/target/linux/generic/pending-5.4/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch
+++ b/target/linux/generic/pending-5.4/681-NET-add-mtd-mac-address-support-to-of_get_mac_addres.patch
@@ -34,7 +34,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
{
struct property *pp = of_find_property(np, name, NULL);
-@@ -72,6 +73,55 @@ static const void *of_get_mac_addr_nvmem
+@@ -72,6 +73,56 @@ static const void *of_get_mac_addr_nvmem
return mac;
}
@@ -84,13 +84,14 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
+
+ return addr;
+#endif
++ return NULL;
+}
+
+
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
* checked first, because that is supposed to contain to "most recent" MAC
-@@ -92,6 +142,10 @@ static const void *of_get_mac_addr_nvmem
+@@ -92,6 +143,10 @@ static const void *of_get_mac_addr_nvmem
* this case, the real MAC is in 'local-mac-address', and 'mac-address' exists
* but is all zeros.
*
@@ -101,7 +102,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* Return: Will be a valid pointer on success and ERR_PTR in case of error.
*/
const void *of_get_mac_address(struct device_node *np)
-@@ -110,6 +164,10 @@ const void *of_get_mac_address(struct de
+@@ -110,6 +165,10 @@ const void *of_get_mac_address(struct de
if (addr)
return addr;
diff --git a/target/linux/generic/pending-5.4/682-of_net-add-mac-address-increment-support.patch b/target/linux/generic/pending-5.4/682-of_net-add-mac-address-increment-support.patch
index 120ef52ff8..2a3f7da222 100644
--- a/target/linux/generic/pending-5.4/682-of_net-add-mac-address-increment-support.patch
+++ b/target/linux/generic/pending-5.4/682-of_net-add-mac-address-increment-support.patch
@@ -65,7 +65,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
{
#ifdef CONFIG_MTD
struct platform_device *pdev = of_find_device_by_node(np);
-@@ -146,28 +151,54 @@ static const void *of_get_mac_address_mt
+@@ -147,28 +152,54 @@ static const void *of_get_mac_address_mt
* If a mtd-mac-address property exists, try to fetch the MAC address from the
* specified mtd device.
*
diff --git a/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch b/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch
index 706a864070..151fd2b0a9 100644
--- a/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch
+++ b/target/linux/generic/pending-5.4/683-of_net-add-mac-address-to-of-tree.patch
@@ -1,7 +1,7 @@
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
-@@ -125,6 +125,33 @@ static void *of_get_mac_address_mtd(stru
- #endif
+@@ -127,6 +127,33 @@ static void *of_get_mac_address_mtd(stru
+ return NULL;
}
+static int of_add_mac_address(struct device_node *np, u8* addr)
@@ -34,7 +34,7 @@
/**
* Search the device tree for the best MAC address to use. 'mac-address' is
-@@ -198,6 +225,7 @@ found:
+@@ -200,6 +227,7 @@ found:
if (!of_property_read_u32(np, "mac-address-increment", &mac_inc))
addr[inc_idx] += mac_inc;