diff options
| author | Jakub Kicinski <[email protected]> | 2022-11-09 19:28:52 -0800 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2022-11-09 19:28:53 -0800 |
| commit | e29edc475f65ec439c468c85d3c81fac1d19ab61 (patch) | |
| tree | 2060d46e9cd37aa97ea8274c82c4128a21cf244b /include/linux | |
| parent | 21780f89d65837e23fef825c79aa836c1cb3a8e9 (diff) | |
| parent | 85a2b4ac34449ed5610301e05dab0f7f9efe278b (diff) | |
Merge branch 'clean-up-pcs-xpcs-accessors'
Russell King says:
====================
Clean up pcs-xpcs accessors
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.
====================
Link: https://lore.kernel.org/r/Y2pm13+SDg6N/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mdio.h | 13 |
1 files changed, 13 insertions, 0 deletions
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); |