* [PATCH net-next 0/2] Clean up pcs-xpcs accessors
@ 2022-11-08 14:25 Russell King (Oracle)
2022-11-08 14:25 ` [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write) Russell King (Oracle)
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Russell King (Oracle) @ 2022-11-08 14:25 UTC (permalink / raw)
To: Jose Abreu
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Heiner Kallweit,
Jakub Kicinski, netdev, Paolo Abeni
Hi,
This series cleans up the pcs-xpcs code to use mdiodev accessors for
read/write just like xpcs_modify_changed() does. In order to do this,
we need to introduce the mdiodev clause 45 accessors.
drivers/net/pcs/pcs-xpcs.c | 10 ++--------
include/linux/mdio.h | 13 +++++++++++++
2 files changed, 15 insertions(+), 8 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write)
2022-11-08 14:25 [PATCH net-next 0/2] Clean up pcs-xpcs accessors Russell King (Oracle)
@ 2022-11-08 14:25 ` Russell King (Oracle)
2022-11-08 15:39 ` Andrew Lunn
2022-11-08 14:26 ` [PATCH net-next 2/2] net: pcs: xpcs: use mdiodev accessors Russell King (Oracle)
2022-11-10 4:00 ` [PATCH net-next 0/2] Clean up pcs-xpcs accessors patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Russell King (Oracle) @ 2022-11-08 14:25 UTC (permalink / raw)
To: Jose Abreu
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Heiner Kallweit,
Jakub Kicinski, netdev, Paolo Abeni
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
include/linux/mdio.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 00177567cfef..f7fbbf3069e7 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -488,6 +488,19 @@ static inline int mdiobus_c45_write(struct mii_bus *bus, int prtad, int devad,
return mdiobus_write(bus, prtad, mdiobus_c45_addr(devad, regnum), val);
}
+static inline int mdiodev_c45_read(struct mdio_device *mdiodev, int devad,
+ u16 regnum)
+{
+ return mdiobus_c45_read(mdiodev->bus, mdiodev->addr, devad, regnum);
+}
+
+static inline int mdiodev_c45_write(struct mdio_device *mdiodev, u32 devad,
+ u16 regnum, u16 val)
+{
+ return mdiobus_c45_write(mdiodev->bus, mdiodev->addr, devad, regnum,
+ val);
+}
+
int mdiobus_register_device(struct mdio_device *mdiodev);
int mdiobus_unregister_device(struct mdio_device *mdiodev);
bool mdiobus_is_registered_device(struct mii_bus *bus, int addr);
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 2/2] net: pcs: xpcs: use mdiodev accessors
2022-11-08 14:25 [PATCH net-next 0/2] Clean up pcs-xpcs accessors Russell King (Oracle)
2022-11-08 14:25 ` [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write) Russell King (Oracle)
@ 2022-11-08 14:26 ` Russell King (Oracle)
2022-11-08 15:40 ` Andrew Lunn
2022-11-10 4:00 ` [PATCH net-next 0/2] Clean up pcs-xpcs accessors patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Russell King (Oracle) @ 2022-11-08 14:26 UTC (permalink / raw)
To: Jose Abreu
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Heiner Kallweit,
Jakub Kicinski, netdev, Paolo Abeni
Use mdiodev accessors rather than accessing the bus and address in
the mdio_device structure and using the mdiobus accessors.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/pcs/pcs-xpcs.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 70f88eae2a9e..f6a038a1d51e 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -188,18 +188,12 @@ static bool __xpcs_linkmode_supported(const struct xpcs_compat *compat,
int xpcs_read(struct dw_xpcs *xpcs, int dev, u32 reg)
{
- struct mii_bus *bus = xpcs->mdiodev->bus;
- int addr = xpcs->mdiodev->addr;
-
- return mdiobus_c45_read(bus, addr, dev, reg);
+ return mdiodev_c45_read(xpcs->mdiodev, dev, reg);
}
int xpcs_write(struct dw_xpcs *xpcs, int dev, u32 reg, u16 val)
{
- struct mii_bus *bus = xpcs->mdiodev->bus;
- int addr = xpcs->mdiodev->addr;
-
- return mdiobus_c45_write(bus, addr, dev, reg, val);
+ return mdiodev_c45_write(xpcs->mdiodev, dev, reg, val);
}
static int xpcs_modify_changed(struct dw_xpcs *xpcs, int dev, u32 reg,
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write)
2022-11-08 14:25 ` [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write) Russell King (Oracle)
@ 2022-11-08 15:39 ` Andrew Lunn
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2022-11-08 15:39 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Jose Abreu, David S. Miller, Eric Dumazet, Heiner Kallweit,
Jakub Kicinski, netdev, Paolo Abeni
On Tue, Nov 08, 2022 at 02:25:56PM +0000, Russell King (Oracle) wrote:
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] net: pcs: xpcs: use mdiodev accessors
2022-11-08 14:26 ` [PATCH net-next 2/2] net: pcs: xpcs: use mdiodev accessors Russell King (Oracle)
@ 2022-11-08 15:40 ` Andrew Lunn
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2022-11-08 15:40 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Jose Abreu, David S. Miller, Eric Dumazet, Heiner Kallweit,
Jakub Kicinski, netdev, Paolo Abeni
On Tue, Nov 08, 2022 at 02:26:01PM +0000, Russell King (Oracle) wrote:
> Use mdiodev accessors rather than accessing the bus and address in
> the mdio_device structure and using the mdiobus accessors.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/2] Clean up pcs-xpcs accessors
2022-11-08 14:25 [PATCH net-next 0/2] Clean up pcs-xpcs accessors Russell King (Oracle)
2022-11-08 14:25 ` [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write) Russell King (Oracle)
2022-11-08 14:26 ` [PATCH net-next 2/2] net: pcs: xpcs: use mdiodev accessors Russell King (Oracle)
@ 2022-11-10 4:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-10 4:00 UTC (permalink / raw)
To: Russell King
Cc: Jose.Abreu, andrew, davem, edumazet, hkallweit1, kuba, netdev,
pabeni
Hello:
This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 8 Nov 2022 14:25:27 +0000 you wrote:
> Hi,
>
> This series cleans up the pcs-xpcs code to use mdiodev accessors for
> read/write just like xpcs_modify_changed() does. In order to do this,
> we need to introduce the mdiodev clause 45 accessors.
>
> drivers/net/pcs/pcs-xpcs.c | 10 ++--------
> include/linux/mdio.h | 13 +++++++++++++
> 2 files changed, 15 insertions(+), 8 deletions(-)
Here is the summary with links:
- [net-next,1/2] net: mdio: add mdiodev_c45_(read|write)
https://git.kernel.org/netdev/net-next/c/f6479ea4e599
- [net-next,2/2] net: pcs: xpcs: use mdiodev accessors
https://git.kernel.org/netdev/net-next/c/85a2b4ac3444
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-10 4:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-08 14:25 [PATCH net-next 0/2] Clean up pcs-xpcs accessors Russell King (Oracle)
2022-11-08 14:25 ` [PATCH net-next 1/2] net: mdio: add mdiodev_c45_(read|write) Russell King (Oracle)
2022-11-08 15:39 ` Andrew Lunn
2022-11-08 14:26 ` [PATCH net-next 2/2] net: pcs: xpcs: use mdiodev accessors Russell King (Oracle)
2022-11-08 15:40 ` Andrew Lunn
2022-11-10 4:00 ` [PATCH net-next 0/2] Clean up pcs-xpcs accessors patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).