Skip to content

Commit 9633b8e

Browse files
InterLinked1push143smart
authored andcommitted
wctdm24xxp, voicebus: Fix DEFINE_SEMAPHORE for RHEL.
RHEL 9.3 and newer also include the newer DEFINE_SEMAPHORE definition in kernels 6.4.0 and newer. Resolves: #67
1 parent 6cdf7a1 commit 9633b8e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/dahdi/voicebus/voicebus.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,15 @@ static void vb_stop_txrx_processors(struct voicebus *vb)
11361136
void voicebus_stop(struct voicebus *vb)
11371137
{
11381138
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
1139+
#if defined(RHEL_RELEASE_VERSION) && defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
1140+
#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 3)
1141+
static DEFINE_SEMAPHORE(stop, 1);
1142+
#else
1143+
static DEFINE_SEMAPHORE(stop);
1144+
#endif /* RHEL_RELEASE_CODE */
1145+
#else
11391146
static DEFINE_SEMAPHORE(stop);
1147+
#endif /* RHEL_RELEASE_VERSION */
11401148
#else
11411149
static DEFINE_SEMAPHORE(stop, 1);
11421150
#endif

drivers/dahdi/wctdm24xxp/base.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,15 @@ mod_hooksig(struct wctdm *wc, struct wctdm_module *mod, enum dahdi_rxsig rxsig)
230230

231231
struct wctdm *ifaces[WC_MAX_IFACES];
232232
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
233+
#if defined(RHEL_RELEASE_VERSION) && defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
234+
#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9, 3)
235+
DEFINE_SEMAPHORE(ifacelock, 1);
236+
#else
237+
DEFINE_SEMAPHORE(ifacelock);
238+
#endif /* RHEL_RELEASE_CODE */
239+
#else
233240
DEFINE_SEMAPHORE(ifacelock);
241+
#endif /* RHEL_RELEASE_VERSION */
234242
#else
235243
DEFINE_SEMAPHORE(ifacelock, 1);
236244
#endif

0 commit comments

Comments
 (0)