Skip to content

Commit 5e44361

Browse files
authored
Merge pull request #45 from Lawstorant/fix-6.15
Fix building on 6.15
2 parents aeb27e6 + 3bc363c commit 5e44361

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

driver/gamepad.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/module.h>
77
#include <linux/uuid.h>
88
#include <linux/timer.h>
9+
#include <linux/version.h>
910

1011
#include "common.h"
1112
#include "../auth/auth.h"
@@ -207,8 +208,11 @@ static int gip_gamepad_init_input(struct gip_gamepad *gamepad)
207208
return 0;
208209

209210
err_delete_timer:
211+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
212+
timer_delete_sync(&gamepad->rumble.timer);
213+
#else
210214
del_timer_sync(&gamepad->rumble.timer);
211-
215+
#endif
212216
return err;
213217
}
214218

@@ -335,7 +339,11 @@ static void gip_gamepad_remove(struct gip_client *client)
335339
{
336340
struct gip_gamepad *gamepad = dev_get_drvdata(&client->dev);
337341

342+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
343+
timer_delete_sync(&gamepad->rumble.timer);
344+
#else
338345
del_timer_sync(&gamepad->rumble.timer);
346+
#endif
339347
}
340348

341349
static struct gip_driver gip_gamepad_driver = {

driver/headset.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/module.h>
77
#include <linux/hrtimer.h>
88
#include <linux/vmalloc.h>
9+
#include <linux/version.h>
910
#include <sound/core.h>
1011
#include <sound/initval.h>
1112
#include <sound/pcm.h>
@@ -499,8 +500,13 @@ static int gip_headset_probe(struct gip_client *client)
499500
INIT_DELAYED_WORK(&headset->work_power_on, gip_headset_power_on);
500501
INIT_WORK(&headset->work_register, gip_headset_register);
501502

503+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
504+
hrtimer_setup(&headset->timer, gip_headset_send_samples,
505+
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
506+
#else
502507
hrtimer_init(&headset->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
503508
headset->timer.function = gip_headset_send_samples;
509+
#endif
504510

505511
err = gip_enable_audio(client);
506512
if (err)

0 commit comments

Comments
 (0)