File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 6
6
#include <linux/module.h>
7
7
#include <linux/uuid.h>
8
8
#include <linux/timer.h>
9
+ #include <linux/version.h>
9
10
10
11
#include "common.h"
11
12
#include "../auth/auth.h"
@@ -207,8 +208,11 @@ static int gip_gamepad_init_input(struct gip_gamepad *gamepad)
207
208
return 0 ;
208
209
209
210
err_delete_timer :
211
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 ,15 ,0 )
212
+ timer_delete_sync (& gamepad -> rumble .timer );
213
+ #else
210
214
del_timer_sync (& gamepad -> rumble .timer );
211
-
215
+ #endif
212
216
return err ;
213
217
}
214
218
@@ -335,7 +339,11 @@ static void gip_gamepad_remove(struct gip_client *client)
335
339
{
336
340
struct gip_gamepad * gamepad = dev_get_drvdata (& client -> dev );
337
341
342
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 ,15 ,0 )
343
+ timer_delete_sync (& gamepad -> rumble .timer );
344
+ #else
338
345
del_timer_sync (& gamepad -> rumble .timer );
346
+ #endif
339
347
}
340
348
341
349
static struct gip_driver gip_gamepad_driver = {
Original file line number Diff line number Diff line change 6
6
#include <linux/module.h>
7
7
#include <linux/hrtimer.h>
8
8
#include <linux/vmalloc.h>
9
+ #include <linux/version.h>
9
10
#include <sound/core.h>
10
11
#include <sound/initval.h>
11
12
#include <sound/pcm.h>
@@ -499,8 +500,13 @@ static int gip_headset_probe(struct gip_client *client)
499
500
INIT_DELAYED_WORK (& headset -> work_power_on , gip_headset_power_on );
500
501
INIT_WORK (& headset -> work_register , gip_headset_register );
501
502
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
502
507
hrtimer_init (& headset -> timer , CLOCK_MONOTONIC , HRTIMER_MODE_REL );
503
508
headset -> timer .function = gip_headset_send_samples ;
509
+ #endif
504
510
505
511
err = gip_enable_audio (client );
506
512
if (err )
You can’t perform that action at this time.
0 commit comments