mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-20 01:16:23 +00:00
ramips: remove unnecessary macros for previous kernel versions
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>
This commit is contained in:
parent
2967e24d02
commit
263fde5ab8
@ -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 = {
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user