1
1

realtek: mdio: convert rtmdio_ctrl_from_bus to static inline

Make the macro type safe.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23204
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Markus Stockhausen 2026-05-03 17:14:26 +02:00 committed by Robert Marko
parent 7d86448543
commit fa4eec38ca

View File

@ -126,9 +126,6 @@
#define for_each_port(ctrl, pn) \
for_each_set_bit(pn, ctrl->valid_ports, RTMDIO_MAX_PORTS)
#define rtmdio_ctrl_from_bus(bus) \
(((struct rtmdio_chan *)(bus)->priv)->ctrl)
/*
* On all Realtek switch platforms the hardware periodically reads the link status of all
* PHYs. This is to some degree programmable, so that one can tell the hardware to read
@ -282,6 +279,11 @@ struct rtmdio_931x_smi_access {
u32 m_ctrl;
};
static inline struct rtmdio_ctrl *rtmdio_ctrl_from_bus(struct mii_bus *bus)
{
return ((struct rtmdio_chan *)bus->priv)->ctrl;
}
static int rtmdio_phy_to_port(struct mii_bus *bus, int phy)
{
struct rtmdio_chan *chan = bus->priv;