Commit b9b40ee4 authored by Thierry Reding's avatar Thierry Reding Committed by David S. Miller

r8152: Use MAC address from correct device tree node

Query the USB device's device tree node when looking for a MAC address.
The struct device embedded into the struct net_device does not have a
device tree node attached at all.

The reason why this went unnoticed is because the system where this was
tested was one of the few development units that had its OTP programmed,
as opposed to production systems where the MAC address is stored in a
separate EEPROM and is passed via device tree by the firmware.
Reported-by: default avatarEJ Hsu <ejh@nvidia.com>
Fixes: acb6d377 ("r8152: Use MAC address from device tree if available")
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarEJ Hsu <ejh@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c7ca03c2
......@@ -1504,7 +1504,7 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
sa->sa_family = dev->type;
ret = eth_platform_get_mac_address(&dev->dev, sa->sa_data);
ret = eth_platform_get_mac_address(&tp->udev->dev, sa->sa_data);
if (ret < 0) {
if (tp->version == RTL_VER_01) {
ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment