diff options
author | Xiaofei Shen <xiaofeis@codeaurora.org> | 2019-03-29 11:04:58 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-01 14:57:32 -0700 |
commit | a2c7023f7075ca9b80f944d3f20f60e6574538e2 (patch) | |
tree | f233ec3606dfa952650e02d2743fed1fa74f83bd /net/dsa/dsa2.c | |
parent | f5d547676ca068e10934687f59ac1e798eaae87a (diff) | |
download | linux-a2c7023f7075ca9b80f944d3f20f60e6574538e2.tar.bz2 |
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.c | 1 |
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: |