Skip to content

Commit 0c3398b

Browse files
committed
update DEFINE_SEMAPHORE usage for linux 6.4+
Linux changed the DEFINE_SEMAPHORE macro in 48380368dec14859723b9e3fbd43e042638d9a76, making it take two parameters instead of one. Pass an explicit 1 as on 6.4+.
1 parent 0bfa3a2 commit 0c3398b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

thinkpad_ec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ static u64 prefetch_jiffies; /* time of prefetch, or: */
9090
/* Locking: */
9191
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
9292
static DECLARE_MUTEX(thinkpad_ec_mutex);
93-
#else
93+
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
9494
static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
95+
#else
96+
static DEFINE_SEMAPHORE(thinkpad_ec_mutex, 1);
9597
#endif
9698

9799
/* Kludge in case the ACPI DSDT reserves the ports we need. */

tp_smapi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ static unsigned short smapi_port; /* APM control port, normally 0xB2 */
111111

112112
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
113113
static DECLARE_MUTEX(smapi_mutex);
114-
#else
114+
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
115115
static DEFINE_SEMAPHORE(smapi_mutex);
116+
#else
117+
static DEFINE_SEMAPHORE(smapi_mutex, 1);
116118
#endif
117119

118120
/**

0 commit comments

Comments
 (0)