diff options
| author | Daniel Golle | 2024-09-20 18:26:52 +0000 |
|---|---|---|
| committer | Daniel Golle | 2024-09-20 18:26:52 +0000 |
| commit | 8181f09049a0e3188f35f27e5b53fc47b39eec87 (patch) | |
| tree | ea7085f2219bb9e1abca70da29e786d331830857 | |
| parent | 3660ddb8ab6e6e4673576a0ee520ea38c67b9d75 (diff) | |
| download | openwrt-8181f09049a0e3188f35f27e5b53fc47b39eec87.tar.gz | |
generic: remove support for older kernels from swconfig
The legacy swconfig switch driver framework supports kernels older than
Linux 6.6 by using #ifdef'ery with LINUX_VERSION_CODE. Remove all that.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | target/linux/generic/files/drivers/net/phy/swconfig.c | 3 | ||||
| -rw-r--r-- | target/linux/generic/files/drivers/net/phy/swconfig_leds.c | 16 |
2 files changed, 0 insertions, 19 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index 5fa2b147c6..10dc8d0607 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c @@ -24,7 +24,6 @@ #include <linux/skbuff.h> #include <linux/switch.h> #include <linux/of.h> -#include <linux/version.h> #include <uapi/linux/mii.h> #define SWCONFIG_DEVNAME "switch%d" @@ -1054,9 +1053,7 @@ static struct genl_family switch_fam = { .module = THIS_MODULE, .ops = swconfig_ops, .n_ops = ARRAY_SIZE(swconfig_ops), -#if LINUX_VERSION_CODE > KERNEL_VERSION(6,0,0) .resv_start_op = SWITCH_CMD_SET_VLAN + 1, -#endif }; #ifdef CONFIG_OF diff --git a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c index 1d309c046c..1fcd4432b5 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c @@ -85,11 +85,7 @@ swconfig_trig_update_port_mask(struct led_trigger *trigger) sw_trig = (void *) trigger; port_mask = 0; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0) spin_lock(&trigger->leddev_list_lock); -#else - read_lock(&trigger->leddev_list_lock); -#endif list_for_each(entry, &trigger->led_cdevs) { struct led_classdev *led_cdev; struct swconfig_trig_data *trig_data; @@ -102,11 +98,7 @@ swconfig_trig_update_port_mask(struct led_trigger *trigger) read_unlock(&trig_data->lock); } } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0) spin_unlock(&trigger->leddev_list_lock); -#else - read_unlock(&trigger->leddev_list_lock); -#endif sw_trig->port_mask = port_mask; @@ -426,22 +418,14 @@ swconfig_trig_update_leds(struct switch_led_trigger *sw_trig) struct led_trigger *trigger; trigger = &sw_trig->trig; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0) spin_lock(&trigger->leddev_list_lock); -#else - read_lock(&trigger->leddev_list_lock); -#endif list_for_each(entry, &trigger->led_cdevs) { struct led_classdev *led_cdev; led_cdev = list_entry(entry, struct led_classdev, trig_list); swconfig_trig_led_event(sw_trig, led_cdev); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0) spin_unlock(&trigger->leddev_list_lock); -#else - read_unlock(&trigger->leddev_list_lock); -#endif } static void |