wifi: mt76: use hrtimer_setup() in mt76x02u beacon init

Replace the two-step hrtimer initialization pattern with a single
consolidated call to hrtimer_setup().
The legacy approach of calling hrtimer_init() followed by manual
assignment to timer.function is deprecated. The new hrtimer_setup()
helper atomically initializes the timer and assigns the callback
function in one operation, eliminating the race-prone intermediate
state where the timer is initialized but lacks a handler.

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
This commit is contained in:
Mieczyslaw Nalewaj
2026-05-04 08:36:55 +00:00
committed by Felix Fietkau
parent 018f60316d
commit 012e52ae38
+2 -2
View File
@@ -264,8 +264,8 @@ void mt76x02u_init_beacon_config(struct mt76x02_dev *dev)
}; };
dev->beacon_ops = &beacon_ops; dev->beacon_ops = &beacon_ops;
hrtimer_init(&dev->pre_tbtt_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); hrtimer_setup(&dev->pre_tbtt_timer, mt76x02u_pre_tbtt_interrupt, CLOCK_MONOTONIC,
dev->pre_tbtt_timer.function = mt76x02u_pre_tbtt_interrupt; HRTIMER_MODE_REL);
INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work); INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work);
mt76x02_init_beacon_config(dev); mt76x02_init_beacon_config(dev);