]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: mdio: convert rtmdio_ctrl_from_bus to static inline
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 3 May 2026 15:14:26 +0000 (17:14 +0200)
committerRobert Marko <robimarko@gmail.com>
Tue, 5 May 2026 11:12:17 +0000 (13:12 +0200)
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>
target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c

index 5cce846ef5f51c07ef4aac5650cf613ccf38e210..9798ec2a420ccf88902b53d0976c28f909edde5a 100644 (file)
 #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;