summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-05-07 12:22:47 -0700
committerDavid S. Miller <davem@davemloft.net>2019-05-07 12:22:47 -0700
commit2e7ae67b5fbbe596cb3e06410970945f975a241a (patch)
treefc9af6d5d1fbcaa88b0eb60e543da7cec1acd12b /drivers/net/usb
parent8e8673a227084923f5b3bb80a68e741aac77948d (diff)
parenta51645f70f6384ae3329551750f7f502cb8de5fc (diff)
downloadlinux-2e7ae67b5fbbe596cb3e06410970945f975a241a.tar.bz2
Merge branch 'of_get_mac_address-ERR_PTR-fixes'
Petr Štetiar says: ==================== of_get_mac_address ERR_PTR fixes this patch series is an attempt to fix the mess, I've somehow managed to introduce. First patch in this series is defacto v5 of the previous 05/10 patch in the series, but since the v4 of this 05/10 patch wasn't picked up by the patchwork for some unknown reason, this patch wasn't applied with the other 9 patches in the series, so I'm resending it as a separate patch of this fixup series again. Second patch is a result of this rebase against net-next tree, where I was checking again all current users of of_get_mac_address and found out, that there's new one in DSA, so I've converted this user to the new ERR_PTR encoded error value as well. Third patch which was sent as v5 wasn't considered for merge, but I still think, that we need to check for possible NULL value, thus current IS_ERR check isn't sufficient and we need to use IS_ERR_OR_NULL instead. Fourth patch fixes warning reported by kbuild test robot. ==================== Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Tested-by: Leonard Crestez <leonard.crestez@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/smsc75xx.c2
-rw-r--r--drivers/net/usb/smsc95xx.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index d27b627b4317..e4c2f3afce60 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -775,7 +775,7 @@ static void smsc75xx_init_mac_address(struct usbnet *dev)
/* maybe the boot loader passed the MAC address in devicetree */
mac_addr = of_get_mac_address(dev->udev->dev.of_node);
if (!IS_ERR(mac_addr)) {
- memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
+ ether_addr_copy(dev->net->dev_addr, mac_addr);
return;
}
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index ab239113351d..a0e119907c84 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -918,7 +918,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
/* maybe the boot loader passed the MAC address in devicetree */
mac_addr = of_get_mac_address(dev->udev->dev.of_node);
if (!IS_ERR(mac_addr)) {
- memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
+ ether_addr_copy(dev->net->dev_addr, mac_addr);
return;
}