]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: pcs: xpcs: add _modify() accessors
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 4 Oct 2024 10:21:22 +0000 (11:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Oct 2024 11:13:11 +0000 (12:13 +0100)
commitce8d6081fcf46d951a5e13134f46c6fedf152632
treeb72b276d14f75b422c1db6d357eab88091036ffc
parentf6818918106113e04796c4558cbd98d01e04f002
net: pcs: xpcs: add _modify() accessors

The xpcs driver does a lot of read-modify-write operations on
registers, which leads to long-winded code to read the register, check
whether the read was successful, modify the value in some way, and then
write it back.

We have a mdiodev _modify() accessor that encapsulates this, and does
the register modification under the MDIO bus lock ensuring that the
modification is atomic with respect to other bus operations. Convert
the xpcs driver to use this accessor.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs-nxp.c
drivers/net/pcs/pcs-xpcs-wx.c
drivers/net/pcs/pcs-xpcs.c
drivers/net/pcs/pcs-xpcs.h