procd: update to git HEAD
[openwrt/openwrt.git] / target / linux / generic / hack-5.10 / 781-dsa-register-every-port-with-of_platform.patch
1 From 8bab551f44204fc5d43977063cd704112c17c750 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Fri, 23 Jul 2021 12:17:27 +0200
4 Subject: [PATCH 2/2] dsa: register every port with of_platform
5
6 The declaration of a different mac-addr using the nvmem framework is
7 currently broken. The dsa code use the generic of_get_mac_address where
8 the nvmem function require the device node to be registred in the
9 of_platform to be found by of_find_device_by_node. Register every port
10 in the of_platform so they can corrently found and a custom mac-addr can
11 correctly be declared using a nvmem-cell declared in the dts.
12
13 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
14 ---
15 net/dsa/dsa2.c | 2 +
16 1 file changed, 2 insertion(+)
17
18 --- a/net/dsa/dsa2.c
19 +++ b/net/dsa/dsa2.c
20 @@ -14,6 +14,7 @@
21 #include <linux/rtnetlink.h>
22 #include <linux/of.h>
23 #include <linux/of_net.h>
24 +#include <linux/of_platform.h>
25 #include <net/devlink.h>
26
27 #include "dsa_priv.h"
28 @@ -288,6 +289,7 @@ static int dsa_port_setup(struct dsa_por
29
30 break;
31 case DSA_PORT_TYPE_USER:
32 + of_platform_device_create(dp->dn, NULL, NULL);
33 dp->mac = of_get_mac_address(dp->dn);
34 err = dsa_slave_create(dp);
35 if (err)