Skip to content

Commit 3aff189

Browse files
committed
hrtimer_init -> hrtimer_setup
1 parent 91a7405 commit 3aff189

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

driver/headset.c

Lines changed: 7 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,7 +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, headset->timer.function,
505+
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
506+
#else
502507
hrtimer_init(&headset->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
508+
#endif
509+
503510
headset->timer.function = gip_headset_send_samples;
504511

505512
err = gip_enable_audio(client);

0 commit comments

Comments
 (0)