]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: mdio: convert to consistent a_to_b() helpers
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 17 May 2026 17:27:45 +0000 (19:27 +0200)
committerRobert Marko <robimarko@gmail.com>
Thu, 21 May 2026 10:10:27 +0000 (12:10 +0200)
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 <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23411
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c

index 533481f91c4cb4ff771fe624f069e99683e0d78e..dddb07207599042b4e62a89104c28372603b50e7 100644 (file)
@@ -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);