fix build issue with 6.4 kernel OBS-URL: https://build.opensuse.org/request/show/1100429 OBS-URL: https://build.opensuse.org/package/show/Base:System/tp_smapi?expand=0&rev=6
31 lines
1.0 KiB
Diff
31 lines
1.0 KiB
Diff
diff -U 3 -dHrN -- a/tp_smapi-0.43/thinkpad_ec.c b/tp_smapi-0.43/thinkpad_ec.c
|
|
--- a/tp_smapi-0.43/thinkpad_ec.c 2018-02-24 16:59:51.000000000 +0100
|
|
+++ b/tp_smapi-0.43/thinkpad_ec.c 2023-07-19 20:40:49.994151707 +0200
|
|
@@ -90,8 +90,10 @@
|
|
/* Locking: */
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
|
|
static DECLARE_MUTEX(thinkpad_ec_mutex);
|
|
-#else
|
|
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
|
|
static DEFINE_SEMAPHORE(thinkpad_ec_mutex);
|
|
+#else
|
|
+static DEFINE_SEMAPHORE(thinkpad_ec_mutex, 1);
|
|
#endif
|
|
|
|
/* Kludge in case the ACPI DSDT reserves the ports we need. */
|
|
diff -U 3 -dHrN -- a/tp_smapi-0.43/tp_smapi.c b/tp_smapi-0.43/tp_smapi.c
|
|
--- a/tp_smapi-0.43/tp_smapi.c 2018-02-24 16:59:51.000000000 +0100
|
|
+++ b/tp_smapi-0.43/tp_smapi.c 2023-07-19 20:40:49.994151707 +0200
|
|
@@ -111,8 +111,10 @@
|
|
|
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
|
|
static DECLARE_MUTEX(smapi_mutex);
|
|
-#else
|
|
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
|
|
static DEFINE_SEMAPHORE(smapi_mutex);
|
|
+#else
|
|
+static DEFINE_SEMAPHORE(smapi_mutex, 1);
|
|
#endif
|
|
|
|
/**
|