ethernet: tg3: remove direct netdev->dev_addr writes
authorJakub Kicinski <kuba@kernel.org>
Fri, 8 Oct 2021 17:59:10 +0000 (10:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Oct 2021 10:46:56 +0000 (11:46 +0100)
commita04436b27a93421634455455174e917dd63887c1
tree5ef6984ce0a9a3618ee5bd22335bcd5df5457b08
parent2b37367065c7d863c087e6ee4b5bf4d97019265e
ethernet: tg3: remove direct netdev->dev_addr writes

tg3 does various forms of direct writes to netdev->dev_addr.
Use a local buffer. Make sure local buffer is aligned since
eth_platform_get_mac_address() may call ether_addr_copy().

tg3_get_device_address() returns whenever it finds a method
that found a valid address. Instead of modifying all the exit
points pass the buffer from the outside and commit the address
in the caller.

Constify the argument of the set addr helper.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c