aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2021-02-20 09:43:35 +0100
committerDavid Bauer <mail@david-bauer.net>2021-02-22 00:55:42 +0100
commit81b44a36264f5a50605c0d5f41d6eb838af4cb75 (patch)
treeaae4df36b465a93deff4e0a689ec2a2a1a31d7d5 /target/linux/ath79
parent777e67301a4e1f62d1dd4e4b00dc2c02f2addbb5 (diff)
downloadupstream-81b44a36264f5a50605c0d5f41d6eb838af4cb75.tar.gz
upstream-81b44a36264f5a50605c0d5f41d6eb838af4cb75.tar.bz2
upstream-81b44a36264f5a50605c0d5f41d6eb838af4cb75.zip
ath79: use ioremap kernel version independent
As mangix pointed out on IRC, ioremap and ioremap_nocache are functionally equivalent on kenrel 5.4 and 5.10. Therefore we can use ioremap regardless of the kernel the driver gets compiled for. Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/ath79')
-rw-r--r--target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c14
1 files changed, 0 insertions, 14 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 2767ad7642..abf7fc7d29 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
@@ -936,11 +936,7 @@ __ag71xx_link_adjust(struct ag71xx *ag, bool update)
* The wr, rr functions cannot be used since this hidden register
* is outside of the normal ag71xx register block.
*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
void __iomem *dam = ioremap(0xb90001bc, 0x4);
-#else
- void __iomem *dam = ioremap_nocache(0xb90001bc, 0x4);
-#endif
if (dam) {
__raw_writel(__raw_readl(dam) & ~BIT(27), dam);
(void)__raw_readl(dam);
@@ -1587,25 +1583,15 @@ static int ag71xx_probe(struct platform_device *pdev)
ag->pllregmap = NULL;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
ag->mac_base = devm_ioremap(&pdev->dev, res->start,
res->end - res->start + 1);
-#else
- ag->mac_base = devm_ioremap_nocache(&pdev->dev, res->start,
- res->end - res->start + 1);
-#endif
if (!ag->mac_base)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (res) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
ag->mii_base = devm_ioremap(&pdev->dev, res->start,
res->end - res->start + 1);
-#else
- ag->mii_base = devm_ioremap_nocache(&pdev->dev, res->start,
- res->end - res->start + 1);
-#endif
if (!ag->mii_base)
return -ENOMEM;
}