mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 22:42:10 +00:00
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>
This commit is contained in:
parent
f5d547676c
commit
a2c7023f70
3 changed files with 6 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue