Skip to content

Fix building on 6.15 #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion driver/gamepad.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/module.h>
#include <linux/uuid.h>
#include <linux/timer.h>
#include <linux/version.h>

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

err_delete_timer:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
timer_delete_sync(&gamepad->rumble.timer);
#else
del_timer_sync(&gamepad->rumble.timer);

#endif
return err;
}

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

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
timer_delete_sync(&gamepad->rumble.timer);
#else
del_timer_sync(&gamepad->rumble.timer);
#endif
}

static struct gip_driver gip_gamepad_driver = {
Expand Down
6 changes: 6 additions & 0 deletions driver/headset.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/module.h>
#include <linux/hrtimer.h>
#include <linux/vmalloc.h>
#include <linux/version.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
Expand Down Expand Up @@ -499,8 +500,13 @@ static int gip_headset_probe(struct gip_client *client)
INIT_DELAYED_WORK(&headset->work_power_on, gip_headset_power_on);
INIT_WORK(&headset->work_register, gip_headset_register);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0)
hrtimer_setup(&headset->timer, gip_headset_send_samples,
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
#else
hrtimer_init(&headset->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
headset->timer.function = gip_headset_send_samples;
#endif

err = gip_enable_audio(client);
if (err)
Expand Down