summaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorXiaofei Shen2019-03-29 06:34:58 +0100
committerDavid S. Miller2019-04-01 23:57:32 +0200
commita2c7023f7075ca9b80f944d3f20f60e6574538e2 (patch)
treef233ec3606dfa952650e02d2743fed1fa74f83bd /net/dsa/dsa2.c
parenttcp: fix tcp_inet6_sk() for 32bit kernels (diff)
downloadkernel-qcow2-linux-a2c7023f7075ca9b80f944d3f20f60e6574538e2.tar.gz
kernel-qcow2-linux-a2c7023f7075ca9b80f944d3f20f60e6574538e2.tar.xz
kernel-qcow2-linux-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: