mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Cc: Nam Cao <namcao@linutronix.de>, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH v2 10/24] net: ethernet: ec_bhf: Switch to use hrtimer_setup()
Date: Wed,  5 Feb 2025 11:43:30 +0100	[thread overview]
Message-ID: <2d8fcf9bf83af507f1ca25cb068af2ac32cdcb2c.1738746872.git.namcao@linutronix.de> (raw)
In-Reply-To: <cover.1738746872.git.namcao@linutronix.de>

hrtimer_setup() takes the callback function pointer as argument and
initializes the timer completely.

Replace hrtimer_init() and the open coded initialization of
hrtimer::function with the new setup mechanism.

Patch was created by using Coccinelle.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/ethernet/ec_bhf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c
index 44af1d13d931..67275aa4f65b 100644
--- a/drivers/net/ethernet/ec_bhf.c
+++ b/drivers/net/ethernet/ec_bhf.c
@@ -416,8 +416,7 @@ static int ec_bhf_open(struct net_device *net_dev)
 
 	netif_start_queue(net_dev);
 
-	hrtimer_init(&priv->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-	priv->hrtimer.function = ec_bhf_timer_fun;
+	hrtimer_setup(&priv->hrtimer, ec_bhf_timer_fun, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	hrtimer_start(&priv->hrtimer, polling_frequency, HRTIMER_MODE_REL);
 
 	return 0;
-- 
2.39.5


  parent reply	other threads:[~2025-02-05 10:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-05 10:43 [PATCH v2 00/24] hrtimers: Consolidate hrtimer initialization - Part 3 Nam Cao
2025-02-05 10:43 ` [PATCH v2 01/24] netdev: Switch to use hrtimer_setup() Nam Cao
2025-02-05 10:43 ` [PATCH v2 02/24] net/sched: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 03/24] mac802154: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 04/24] tcp: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 05/24] can: m_can: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 06/24] can: mcp251xfd: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 07/24] can: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 08/24] net: ethernet: ti: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 09/24] net: ethernet: cortina: " Nam Cao
2025-02-05 10:43 ` Nam Cao [this message]
2025-02-05 10:43 ` [PATCH v2 11/24] net: ethernet: hisilicon: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 12/24] net: sparx5: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 13/24] net: ieee802154: at86rf230: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 14/24] net: mvpp2: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 15/24] net: qualcomm: rmnet: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 16/24] net: stmmac: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 17/24] net: fec: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 18/24] net: wwan: iosm: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 19/24] net/cdc_ncm: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 20/24] wifi: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 21/24] wifi: rt2x00: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 22/24] igc: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 23/24] octeontx2-pf: " Nam Cao
2025-02-05 10:43 ` [PATCH v2 24/24] xfrm: " Nam Cao

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=2d8fcf9bf83af507f1ca25cb068af2ac32cdcb2c.1738746872.git.namcao@linutronix.de \
    --to=namcao@linutronix.de \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®