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

View File

@@ -862,8 +862,13 @@ static int ccat_eth_open(struct net_device *dev)
struct ccat_eth_priv *const priv = netdev_priv(dev);
if (!priv->ecdev) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
hrtimer_setup(&priv->poll_timer, poll_timer_callback,
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
#else
hrtimer_init(&priv->poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
priv->poll_timer.function = poll_timer_callback;
#endif
hrtimer_start(&priv->poll_timer, POLL_TIME, HRTIMER_MODE_REL);
}
return 0;

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));