ath79: use ioremap kernel version independent
[openwrt/staging/zorun.git] / target / linux / ath79 / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_main.c
index 2767ad76421244c3eb7afa48b824325a68ff249c..abf7fc7d29d89dc1132721cd5abe3ca3ef48fc6b 100644 (file)
@@ -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;
        }