From: Andrew Lunn <andrew@lunn.ch>
To: Daniel Golle <daniel@makrotopia.org>
Cc: Hauke Mehrtens <hauke@hauke-m.de>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Andreas Schirm <andreas.schirm@siemens.com>,
Lukas Stockmann <lukas.stockmann@siemens.com>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>,
Peter Christen <peter.christen@siemens.com>,
Avinash Jayaraman <ajayaraman@maxlinear.com>,
Bing tao Xu <bxu@maxlinear.com>, Liang Xu <lxu@maxlinear.com>,
Juraj Povazanec <jpovazanec@maxlinear.com>,
"Fanni (Fang-Yi) Chan" <fchan@maxlinear.com>,
"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
"Livia M. Rosu" <lrosu@maxlinear.com>,
John Crispin <john@phrozen.org>
Subject: Re: [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap
Date: Wed, 22 Oct 2025 04:35:28 +0200 [thread overview]
Message-ID: <37673fb9-b40d-4fb6-aa7b-09cc1fcd2499@lunn.ch> (raw)
In-Reply-To: <594cd080da549a1d8353642a40ad4630b75c7e33.1760877626.git.daniel@makrotopia.org>
On Sun, Oct 19, 2025 at 01:48:22PM +0100, Daniel Golle wrote:
> Use coccinelle semantic patch to convert all trivial uses of the register
> accessor functions to use the regmap API directly.
>
> // Replace gswip_switch_w with regmap_write
> @@
> expression priv, val, offset;
> @@
> - gswip_switch_w(priv, val, offset)
> + regmap_write(priv->gswip, offset, val)
>
> // Replace gswip_mdio_w with regmap_write
> @@
> expression priv, val, offset;
> @@
> - gswip_mdio_w(priv, val, offset)
> + regmap_write(priv->mdio, offset, val)
>
> // Replace gswip_switch_r in simple assignment - only for u32
> @@
> expression priv, offset;
> u32 var;
> @@
> - var = gswip_switch_r(priv, offset)
> + regmap_read(priv->gswip, offset, &var)
>
> // Replace gswip_switch_mask with regmap_set_bits when clear is 0
> @@
> expression priv, set, offset;
> @@
> - gswip_switch_mask(priv, 0, set, offset)
> + regmap_set_bits(priv->gswip, offset, set)
>
> // Replace gswip_mdio_mask with regmap_set_bits when clear is 0
> @@
> expression priv, set, offset;
> @@
> - gswip_mdio_mask(priv, 0, set, offset)
> + regmap_set_bits(priv->mdio, offset, set)
>
> // Replace gswip_switch_mask with regmap_clear_bits when set is 0
> @@
> expression priv, clear, offset;
> @@
> - gswip_switch_mask(priv, clear, 0, offset)
> + regmap_clear_bits(priv->gswip, offset, clear)
>
> // Replace gswip_mdio_mask with regmap_clear_bits when set is 0
> @@
> expression priv, clear, offset;
> @@
> - gswip_mdio_mask(priv, clear, 0, offset)
> + regmap_clear_bits(priv->mdio, offset, clear)
>
> Remove gswip_switch_w() and gswip_mdio_w() functions as they now no
> longer have any users.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2025-10-22 2:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-19 12:46 [PATCH net-next v3 0/7] net: dsa: lantiq_gswip: use regmap for register access Daniel Golle
2025-10-19 12:46 ` [PATCH net-next v3 1/7] net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment Daniel Golle
2025-10-22 2:29 ` Andrew Lunn
2025-10-22 7:43 ` Daniel Golle
2025-10-19 12:47 ` [PATCH net-next v3 2/7] net: dsa: lantiq_gswip: convert accessors to use regmap Daniel Golle
2025-10-22 2:34 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 3/7] net: dsa: lantiq_gswip: convert trivial accessor uses to regmap Daniel Golle
2025-10-22 2:35 ` Andrew Lunn [this message]
2025-10-19 12:48 ` [PATCH net-next v3 4/7] net: dsa: lantiq_gswip: manually convert remaining uses of read accessors Daniel Golle
2025-10-19 22:25 ` Jakub Kicinski
2025-10-20 0:23 ` Daniel Golle
2025-10-19 12:48 ` [PATCH net-next v3 5/7] net: dsa: lantiq_gswip: replace *_mask() functions with regmap API Daniel Golle
2025-10-22 2:36 ` Andrew Lunn
2025-10-19 12:48 ` [PATCH net-next v3 6/7] net: dsa: lantiq_gswip: optimize regmap_write_bits() statements Daniel Golle
2025-10-19 12:48 ` [PATCH net-next v3 7/7] net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters Daniel Golle
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=37673fb9-b40d-4fb6-aa7b-09cc1fcd2499@lunn.ch \
--to=andrew@lunn.ch \
--cc=ajayaraman@maxlinear.com \
--cc=alexander.sverdlin@siemens.com \
--cc=andreas.schirm@siemens.com \
--cc=bxu@maxlinear.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fchan@maxlinear.com \
--cc=hauke@hauke-m.de \
--cc=john@phrozen.org \
--cc=jpovazanec@maxlinear.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lrosu@maxlinear.com \
--cc=lukas.stockmann@siemens.com \
--cc=lxu@maxlinear.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=peter.christen@siemens.com \
--cc=yweng@maxlinear.com \
/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®