Skip to content

Commit d84ac75

Browse files
committed
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 <namiltd@yahoo.com>
1 parent b2fe7f1 commit d84ac75

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

mt76x02_usb_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ void mt76x02u_init_beacon_config(struct mt76x02_dev *dev)
264264
};
265265
dev->beacon_ops = &beacon_ops;
266266

267-
hrtimer_init(&dev->pre_tbtt_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
268-
dev->pre_tbtt_timer.function = mt76x02u_pre_tbtt_interrupt;
267+
hrtimer_setup(&dev->pre_tbtt_timer, mt76x02u_pre_tbtt_interrupt,
268+
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
269269
INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work);
270270

271271
mt76x02_init_beacon_config(dev);

0 commit comments

Comments
 (0)