Switched from hrtimer_init() to hrtimer_setup() with Linux 6.15.

This commit is contained in:
Florian Pose
2025-06-10 12:08:09 +02:00
parent 240080f110
commit 354f1493cc
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -1401,8 +1401,13 @@ void ec_master_nanosleep(const unsigned long nsecs)
struct hrtimer_sleeper t;
enum hrtimer_mode mode = HRTIMER_MODE_REL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
hrtimer_setup(&t.timer, ec_master_nanosleep_wakeup,
CLOCK_MONOTONIC, mode);
#else
hrtimer_init(&t.timer, CLOCK_MONOTONIC, mode);
t.timer.function = ec_master_nanosleep_wakeup;
#endif
t.task = current;
hrtimer_set_expires(&t.timer, ktime_set(0, nsecs));