Skip to content

Commit b9b40ee

Browse files
thierryredingdavem330
authored andcommitted
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: EJ Hsu <[email protected]> Fixes: acb6d37 ("r8152: Use MAC address from device tree if available") Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: EJ Hsu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c7ca03c commit b9b40ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/usb/r8152.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
15041504

15051505
sa->sa_family = dev->type;
15061506

1507-
ret = eth_platform_get_mac_address(&dev->dev, sa->sa_data);
1507+
ret = eth_platform_get_mac_address(&tp->udev->dev, sa->sa_data);
15081508
if (ret < 0) {
15091509
if (tp->version == RTL_VER_01) {
15101510
ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);

0 commit comments

Comments
 (0)