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
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.
13 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
16 1 file changed, 2 insertion(+)
21 #include <linux/rtnetlink.h>
23 #include <linux/of_net.h>
24 +#include <linux/of_platform.h>
25 #include <net/devlink.h>
28 @@ -288,6 +289,7 @@ static int dsa_port_setup(struct dsa_por
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);