ramips: remove unnecessary macros for previous kernel versions
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Fri, 3 May 2024 17:35:11 +0000 (19:35 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 3 May 2024 22:02:00 +0000 (23:02 +0100)
Remove unnecessary 'if' macros for previous kernel versions.
After removing kernel 6.1 the kernel is always >= 6.6 so the conditions
are unnecessary.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
[removed some more and also no longer include version.h]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c

index ca3b6fb302e68739776425923e33501526a1993f..5d4cebb089684e25ce1538e3a0e7c82c9ca8f543 100644 (file)
@@ -199,20 +199,12 @@ static void fe_get_ethtool_stats(struct net_device *dev,
        do {
                data_src = &hwstats->tx_bytes;
                data_dst = data;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
                start = u64_stats_fetch_begin(&hwstats->syncp);
-#else
-               start = u64_stats_fetch_begin_irq(&hwstats->syncp);
-#endif
 
                for (i = 0; i < ARRAY_SIZE(fe_gdma_str); i++)
                        *data_dst++ = *data_src++;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
        } while (u64_stats_fetch_retry(&hwstats->syncp, start));
-#else
-       } while (u64_stats_fetch_retry_irq(&hwstats->syncp, start));
-#endif
 }
 
 static struct ethtool_ops fe_ethtool_ops = {
index 4365e398d3fce9e1e5b3dcd36a359d8a2309b309..c8afa4e3bb8f9f3c1bcccdf8b8fc48ec32d54d84 100644 (file)
@@ -487,11 +487,7 @@ static void fe_get_stats64(struct net_device *dev,
        }
 
        do {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
                start = u64_stats_fetch_begin(&hwstats->syncp);
-#else
-               start = u64_stats_fetch_begin_irq(&hwstats->syncp);
-#endif
                storage->rx_packets = hwstats->rx_packets;
                storage->tx_packets = hwstats->tx_packets;
                storage->rx_bytes = hwstats->rx_bytes;
@@ -503,11 +499,7 @@ static void fe_get_stats64(struct net_device *dev,
                storage->rx_crc_errors = hwstats->rx_fcs_errors;
                storage->rx_errors = hwstats->rx_checksum_errors;
                storage->tx_aborted_errors = hwstats->tx_skip;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
        } while (u64_stats_fetch_retry(&hwstats->syncp, start));
-#else
-       } while (u64_stats_fetch_retry_irq(&hwstats->syncp, start));
-#endif
 
        storage->tx_errors = priv->netdev->stats.tx_errors;
        storage->rx_dropped = priv->netdev->stats.rx_dropped;
index 364dd54a58f121fc13d22b23cc0ae52a2e3f7bcc..151caae1dcc3aeb2c7b82d8ff3f3160158af142a 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/phy.h>
 #include <linux/ethtool.h>
-#include <linux/version.h>
 
 enum fe_reg {
        FE_REG_PDMA_GLO_CFG = 0,
index a429bb82a3a08121e187ad05e8f50f335d40eb30..8b642e28b19abe0a4d7a44b03555236124b9de70 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/version.h>
 #include <linux/gpio/consumer.h>
 #include <linux/gpio/driver.h>
 #include <linux/pinctrl/pinconf.h>
@@ -810,11 +809,7 @@ static int aw9523_init_gpiochip(struct aw9523 *awi, unsigned int npins)
        gpiochip->set_multiple = aw9523_gpio_set_multiple;
        gpiochip->set_config = gpiochip_generic_config;
        gpiochip->parent = dev;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
        gpiochip->fwnode = dev->fwnode;
-#else
-       gpiochip->of_node = dev->of_node;
-#endif
        gpiochip->owner = THIS_MODULE;
        gpiochip->can_sleep = true;
 
@@ -988,12 +983,7 @@ static int aw9523_hw_init(struct aw9523 *awi)
        return regmap_reinit_cache(awi->regmap, &aw9523_regmap);
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
 static int aw9523_probe(struct i2c_client *client)
-#else
-static int aw9523_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
-#endif
 {
        struct device *dev = &client->dev;
        struct pinctrl_desc *pdesc;