Skip to content

net: dsa: lantiq_gswip: use regmap for register access

Daniel Golle lkml netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest7 patches 2 repliesApplied 7/7
  2. v47 patches 2 repliesSuperseded
  3. v37 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v27 patches1 replySuperseded

Changes in v5 from the cover letter

* use REGMAP_UPSHIFT(2) macro instead of -2 value for reg_shift

Patches in v5 All 7 applied

#Subject and filesSizeRepliesApplied
1/7net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in commentdrivers/net/dsa/lantiq/lantiq_gswip.c+5 -10 repliesApplied
2/7net: dsa: lantiq_gswip: convert accessors to use regmapdrivers/net/dsa/lantiq/Kconfig drivers/net/dsa/lantiq/lantiq_gswip.c drivers/net/dsa/lantiq/lantiq_gswip.h+67 -471 replyApplied
3/7net: dsa: lantiq_gswip: convert trivial accessor uses to regmapdrivers/net/dsa/lantiq/lantiq_gswip.c+76 -840 repliesApplied
4/7net: dsa: lantiq_gswip: manually convert remaining uses of read accessorsdrivers/net/dsa/lantiq/lantiq_gswip.c+38 -400 repliesApplied
5/7net: dsa: lantiq_gswip: replace *_mask() functions with regmap APIdrivers/net/dsa/lantiq/lantiq_gswip.c+70 -700 repliesApplied
6/7net: dsa: lantiq_gswip: optimize regmap_write_bits() statementsdrivers/net/dsa/lantiq/lantiq_gswip.c+15 -180 repliesApplied
7/7net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parametersdrivers/net/dsa/lantiq/lantiq_gswip.c+7 -100 repliesApplied

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchAlexander SverdlinMaxime Chevallier
SeriesT-b
1/7
2/7R-b
3/7
4/7
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH net-next v5 0/7] net: dsa: lantiq_gswip: use regmap for register access

This series refactors the lantiq_gswip driver to utilize the regmap API for register access, replacing the previous approach of open-coding register operations.

Using regmap paves the way for supporting different busses to access the switch registers, for example it makes it easier to use an MDIO-based method required to access the registers of the MaxLinear GSW1xx series of dedicated switch ICs.

Apart from that, the use of regmap improves readability and maintainability of the driver by standardizing register access.

When ever possible changes were made using Coccinelle semantic patches, sometimes adjusting white space and adding line breaks when needed. The remaining changes which were not done using semantic patches are small and should be easy to review and verify.

The whole series has been

---
Changes since v4:
* use REGMAP_UPSHIFT(2) macro instead of -2 value for reg_shift

Changes since v3:
* unlock mutex in error path
* simplify some of the manually converted register reads by changing the type to u32 instead of using a u32 tmp variable and then assigning the value to the previously used u16 variable.

Changes since v2:
* correctly target net-next tree (fix typo in subject)

Changes since RFC:
* drop error handling, it wasn't there before and it would anyway be removed again by a follow-up change
* optimize more of the regmap_write_bits() calls

Daniel Golle (7):
net: dsa: lantiq_gswip: clarify GSWIP 2.2 VLAN mode in comment
net: dsa: lantiq_gswip: convert accessors to use regmap
net: dsa: lantiq_gswip: convert trivial accessor uses to regmap
net: dsa: lantiq_gswip: manually convert remaining uses of read
accessors
net: dsa: lantiq_gswip: replace *_mask() functions with regmap API
net: dsa: lantiq_gswip: optimize regmap_write_bits() statements
net: dsa: lantiq_gswip: harmonize gswip_mii_mask_*() parameters

 drivers/net/dsa/lantiq/Kconfig        |   1 +
 drivers/net/dsa/lantiq/lantiq_gswip.c | 471 +++++++++++++-------------
 drivers/net/dsa/lantiq/lantiq_gswip.h |   6 +-
 3 files changed, 243 insertions(+), 235 deletions(-)
Signature · 1 line
2.51.1