From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
To: linux-wireless@vger.kernel.org
Subject: [PATCH] wifi: mt76: use hrtimer_setup() in mt76x02u beacon init
Date: Mon, 20 Apr 2026 16:42:30 +0200 [thread overview]
Message-ID: <321f7c0e-2ae7-4633-beac-51bcfac4f4bb@yahoo.com> (raw)
In-Reply-To: 321f7c0e-2ae7-4633-beac-51bcfac4f4bb.ref@yahoo.com
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>
---
mt76x02_usb_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mt76x02_usb_core.c b/mt76x02_usb_core.c
index c94c2f661..3a28a8cc1 100644
--- a/mt76x02_usb_core.c
+++ b/mt76x02_usb_core.c
@@ -264,8 +264,8 @@ void mt76x02u_init_beacon_config(struct mt76x02_dev *dev)
};
dev->beacon_ops = &beacon_ops;
- hrtimer_init(&dev->pre_tbtt_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- dev->pre_tbtt_timer.function = mt76x02u_pre_tbtt_interrupt;
+ hrtimer_setup(&dev->pre_tbtt_timer, mt76x02u_pre_tbtt_interrupt, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work);
mt76x02_init_beacon_config(dev);
--
2.53.0
next parent reply other threads:[~2026-04-20 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <321f7c0e-2ae7-4633-beac-51bcfac4f4bb.ref@yahoo.com>
2026-04-20 14:42 ` Mieczyslaw Nalewaj [this message]
2026-04-20 17:32 ` [PATCH] wifi: mt76: use hrtimer_setup() in mt76x02u beacon init Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=321f7c0e-2ae7-4633-beac-51bcfac4f4bb@yahoo.com \
--to=namiltd@yahoo.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox