net: usb: support of_get_mac_address new ERR_PTR error
authorPetr Štetiar <ynezz@true.cz>
Fri, 3 May 2019 14:27:11 +0000 (16:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 May 2019 04:47:07 +0000 (21:47 -0700)
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>
drivers/net/usb/smsc75xx.c
drivers/net/usb/smsc95xx.c

index ec287c9741e833eb2af7b2878ee08ff1941227b0..d27b627b4317d8b5095bfd049fce1abf6abeb576 100644 (file)
@@ -774,7 +774,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 (mac_addr) {
+       if (!IS_ERR(mac_addr)) {
                memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
                return;
        }
index e3d08626828e4890a413d1081fa8beba8398636d..ab239113351dc4085f2e9e52e8db0efa227734f7 100644 (file)
@@ -917,7 +917,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 (mac_addr) {
+       if (!IS_ERR(mac_addr)) {
                memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN);
                return;
        }