Skip to content

Commit ff7fa05

Browse files
ynezzclaudiubeznea
authored andcommitted
net: usb: support of_get_mac_address new ERR_PTR error
There was NVMEM support added to of_get_mac_address, so it could now return ERR_PTR encoded error values, so we need to adjust all current users of of_get_mac_address to this new fact. Signed-off-by: Petr Štetiar <ynezz@true.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a2e39c1 commit ff7fa05

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/usb/smsc75xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ static void smsc75xx_init_mac_address(struct usbnet *dev)
774774

775775
/* maybe the boot loader passed the MAC address in devicetree */
776776
mac_addr = of_get_mac_address(dev->udev->dev.of_node);
777-
if (mac_addr) {
777+
if (!IS_ERR(mac_addr)) {
778778
memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
779779
return;
780780
}

drivers/net/usb/smsc95xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
919919

920920
/* maybe the boot loader passed the MAC address in devicetree */
921921
mac_addr = of_get_mac_address(dev->udev->dev.of_node);
922-
if (mac_addr) {
922+
if (!IS_ERR(mac_addr)) {
923923
memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
924924
return;
925925
}

0 commit comments

Comments
 (0)