From 977be810c94a4df132e0ba15b10d1128f86a7c8b Mon Sep 17 00:00:00 2001 From: zfdx <47835976+zfdx123@users.noreply.github.com> Date: Tue, 28 Feb 2023 10:20:55 +0800 Subject: [PATCH] generic/5.15: fix swconfig_leds.c build (#10938) Fixes: ebfa1b9 ("generic: fix swconfig_leds.c in 5.18") --- .../linux/generic/files/drivers/net/phy/swconfig_leds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 95dbdb76f..767d9221b 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c @@ -85,7 +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, 15, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) spin_lock(&trigger->leddev_list_lock); #else read_lock(&trigger->leddev_list_lock); @@ -102,7 +102,7 @@ swconfig_trig_update_port_mask(struct led_trigger *trigger) read_unlock(&trig_data->lock); } } -#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 15, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) spin_unlock(&trigger->leddev_list_lock); #else read_unlock(&trigger->leddev_list_lock); @@ -425,7 +425,7 @@ 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, 15, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) spin_lock(&trigger->leddev_list_lock); #else read_lock(&trigger->leddev_list_lock); @@ -436,7 +436,7 @@ swconfig_trig_update_leds(struct switch_led_trigger *sw_trig) 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, 15, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) spin_unlock(&trigger->leddev_list_lock); #else read_unlock(&trigger->leddev_list_lock);