]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: mdio: add unlocked mdiodev C45 bus accessors
authorDaniel Golle <daniel@makrotopia.org>
Sat, 7 Feb 2026 03:07:18 +0000 (03:07 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 11 Feb 2026 10:27:58 +0000 (11:27 +0100)
Add helper inline functions __mdiodev_c45_read() and
__mdiodev_c45_write(), which are the C45 equivalents of the existing
__mdiodev_read() and __mdiodev_write() added by commit e6a45700e7e1
("net: mdio: add unlocked mdiobus and mdiodev bus accessors")

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/8d1d55949a75a871d2a3b90e421de4bd58d77685.1770433307.git.daniel@makrotopia.org
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/linux/mdio.h

index 7ad7ce48f5313d7d9b681676e90b7efdf9e701c7..5d1203b9af205c024f899014e7e5e403fad6b35c 100644 (file)
@@ -647,6 +647,19 @@ static inline int mdiodev_modify_changed(struct mdio_device *mdiodev,
                                      mask, set);
 }
 
+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);
+}
+
 static inline int mdiodev_c45_modify(struct mdio_device *mdiodev, int devad,
                                     u32 regnum, u16 mask, u16 set)
 {