mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-05 19:39:50 +08:00
Switched from hrtimer_init() to hrtimer_setup() with Linux 6.15.
This commit is contained in:
@@ -862,8 +862,13 @@ static int ccat_eth_open(struct net_device *dev)
|
|||||||
struct ccat_eth_priv *const priv = netdev_priv(dev);
|
struct ccat_eth_priv *const priv = netdev_priv(dev);
|
||||||
|
|
||||||
if (!priv->ecdev) {
|
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);
|
hrtimer_init(&priv->poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||||
priv->poll_timer.function = poll_timer_callback;
|
priv->poll_timer.function = poll_timer_callback;
|
||||||
|
#endif
|
||||||
hrtimer_start(&priv->poll_timer, POLL_TIME, HRTIMER_MODE_REL);
|
hrtimer_start(&priv->poll_timer, POLL_TIME, HRTIMER_MODE_REL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -1401,8 +1401,13 @@ void ec_master_nanosleep(const unsigned long nsecs)
|
|||||||
struct hrtimer_sleeper t;
|
struct hrtimer_sleeper t;
|
||||||
enum hrtimer_mode mode = HRTIMER_MODE_REL;
|
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);
|
hrtimer_init(&t.timer, CLOCK_MONOTONIC, mode);
|
||||||
t.timer.function = ec_master_nanosleep_wakeup;
|
t.timer.function = ec_master_nanosleep_wakeup;
|
||||||
|
#endif
|
||||||
t.task = current;
|
t.task = current;
|
||||||
hrtimer_set_expires(&t.timer, ktime_set(0, nsecs));
|
hrtimer_set_expires(&t.timer, ktime_set(0, nsecs));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user