ath79: ag71xx: unify version dependent code
[openwrt/staging/dedeckeh.git] / target / linux / ath79 / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_main.c
index 0db11a6785bc599fac00259be388206456c5298f..2c9777ba536df5ed513d5a61d1781b653890bf15 100644 (file)
@@ -1549,11 +1549,7 @@ static int ag71xx_probe(struct platform_device *pdev)
        ag->stop_desc->next = (u32) ag->stop_desc_dma;
 
        mac_addr = of_get_mac_address(np);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0))
-       if (!mac_addr || !is_valid_ether_addr(mac_addr)) {
-#else
-       if (IS_ERR(mac_addr) || !is_valid_ether_addr(mac_addr)) {
-#endif
+       if (IS_ERR_OR_NULL(mac_addr) || !is_valid_ether_addr(mac_addr)) {
                dev_err(&pdev->dev, "invalid MAC address, using random address\n");
                eth_random_addr(dev->dev_addr);
        } else {