diff options
author | David Bauer <mail@david-bauer.net> | 2020-04-27 12:18:09 +0200 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2020-04-27 12:21:45 +0200 |
commit | c76046991830ee6d61594acb51884bd2ef8bebc8 (patch) | |
tree | 057ff1f8b5627a350d5343cccb67d3b1ade76fa6 /target/linux | |
parent | 5358d8b995f7aa52e16dd45cef082fc9983c8b39 (diff) | |
download | upstream-c76046991830ee6d61594acb51884bd2ef8bebc8.tar.gz upstream-c76046991830ee6d61594acb51884bd2ef8bebc8.tar.bz2 upstream-c76046991830ee6d61594acb51884bd2ef8bebc8.zip |
ath79: ag71xx: unify version dependent code
Use IS_ERR_OR_NULL macro to use the same code on kernel 4.19 as well as
5.4.
Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 0db11a6785..2c9777ba53 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -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 { |