From: Markus Stockhausen Date: Sun, 3 May 2026 15:14:26 +0000 (+0200) Subject: realtek: mdio: convert rtmdio_ctrl_from_bus to static inline X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa4eec38ca96808e23a05c09c7ad0a5cb3c1ddd1;p=thirdparty%2Fopenwrt.git realtek: mdio: convert rtmdio_ctrl_from_bus to static inline Make the macro type safe. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/23204 Signed-off-by: Robert Marko --- diff --git a/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c index 5cce846ef5f..9798ec2a420 100644 --- a/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c @@ -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;