aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorXiaofei Shen <xiaofeis@codeaurora.org>2019-03-29 11:04:58 +0530
committerDavid S. Miller <davem@davemloft.net>2019-04-01 14:57:32 -0700
commita2c7023f7075ca9b80f944d3f20f60e6574538e2 (patch)
treef233ec3606dfa952650e02d2743fed1fa74f83bd /net/dsa/dsa2.c
parenttcp: fix tcp_inet6_sk() for 32bit kernels (diff)
downloadlinux-dev-a2c7023f7075ca9b80f944d3f20f60e6574538e2.tar.xz
linux-dev-a2c7023f7075ca9b80f944d3f20f60e6574538e2.zip
net: dsa: read mac address from DT for slave device
Before creating a slave netdevice, get the mac address from DTS and apply in case it is valid. Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org> Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r--net/dsa/dsa2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index fe0a6197db9c..0e1cce460406 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -266,6 +266,7 @@ static int dsa_port_setup(struct dsa_port *dp)
return 0;
memset(&dp->devlink_port, 0, sizeof(dp->devlink_port));
+ dp->mac = of_get_mac_address(dp->dn);
switch (dp->type) {
case DSA_PORT_TYPE_CPU: