From b8fc512a052f3bd560c9ec73ae7c8adb4ed86634 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Sun, 17 May 2026 19:27:45 +0200 Subject: [PATCH] realtek: mdio: convert to consistent a_to_b() helpers Majority of kernel uses a_to_b(a) instead of b_from_a(a). Convert to that to be consistent with all helpers in the driver. Additionally drop inline function definitions. Let the compiler decide what is best. Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/23411 Signed-off-by: Robert Marko --- .../files-6.18/drivers/net/mdio/mdio-realtek-otto.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 533481f91c..dddb072075 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 @@ -269,7 +269,7 @@ struct rtmd_phy_info { unsigned int poll_lpa_1000; }; -static inline struct rtmd_ctrl *rtmd_ctrl_from_bus(struct mii_bus *bus) +static struct rtmd_ctrl *rtmd_bus_to_ctrl(struct mii_bus *bus) { return ((struct rtmd_chan *)bus->priv)->ctrl; } @@ -284,7 +284,7 @@ static int rtmd_phy_to_port(struct mii_bus *bus, int phy) static int rtmd_run_cmd(struct mii_bus *bus, u32 cmd, struct rtmd_command_data *cmd_data, u32 *val) { - struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus); + struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus); u32 cmdstate; int ret; @@ -522,7 +522,7 @@ static int rtmd_931x_write_c45(struct mii_bus *bus, u32 pn, u32 devnum, u32 regn static int rtmd_read_c45(struct mii_bus *bus, int phy, int devnum, int regnum) { - struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus); + struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus); int ret, pn, val = 0; pn = rtmd_phy_to_port(bus, phy); @@ -539,7 +539,7 @@ static int rtmd_read_c45(struct mii_bus *bus, int phy, int devnum, int regnum) static int rtmd_read_c22(struct mii_bus *bus, int phy, int regnum) { - struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus); + struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus); int ret, pn, val = 0; pn = rtmd_phy_to_port(bus, phy); @@ -562,7 +562,7 @@ static int rtmd_read_c22(struct mii_bus *bus, int phy, int regnum) static int rtmd_write_c45(struct mii_bus *bus, int phy, int devnum, int regnum, u16 val) { - struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus); + struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus); int ret, pn; pn = rtmd_phy_to_port(bus, phy); @@ -579,7 +579,7 @@ static int rtmd_write_c45(struct mii_bus *bus, int phy, int devnum, int regnum, static int rtmd_write_c22(struct mii_bus *bus, int phy, int regnum, u16 val) { - struct rtmd_ctrl *ctrl = rtmd_ctrl_from_bus(bus); + struct rtmd_ctrl *ctrl = rtmd_bus_to_ctrl(bus); int ret, page, pn; pn = rtmd_phy_to_port(bus, phy);