]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: mdiobus: add clause 45 mdiobus write accessor
authorIoana Ciornei <ioana.ciornei@nxp.com>
Sun, 30 Aug 2020 08:34:00 +0000 (11:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2020 19:52:33 +0000 (12:52 -0700)
Add the locked variant of the clause 45 mdiobus write accessor -
mdiobus_c45_write().

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/mdio.h

index 898cbf00332a2e1124eee2895796f53a756e41cb..3a88b699b7581a2bad9b45141adf5a23c98fbf20 100644 (file)
@@ -358,6 +358,12 @@ static inline int mdiobus_c45_read(struct mii_bus *bus, int prtad, int devad,
        return mdiobus_read(bus, prtad, mdiobus_c45_addr(devad, regnum));
 }
 
+static inline int mdiobus_c45_write(struct mii_bus *bus, int prtad, int devad,
+                                   u16 regnum, u16 val)
+{
+       return mdiobus_write(bus, prtad, mdiobus_c45_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);