[openwrt/openwrt] realtek: mdio: configure bus read/write only once.

LEDE Commits lede-commits at lists.infradead.org
Mon Dec 29 03:57:11 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3fb1c9c6259ef1d4916c7f1f40988a5e4275337c

commit 3fb1c9c6259ef1d4916c7f1f40988a5e4275337c
Author: Markus Stockhausen <markus.stockhausen at gmx.de>
AuthorDate: Wed Dec 24 12:19:02 2025 +0100

    realtek: mdio: configure bus read/write only once.
    
    For all families the driver uses the same read/write functions.
    Drop the duplicate per-family initialization.
    
    Signed-off-by: Markus Stockhausen <markus.stockhausen at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/21274
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c   | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
index 04cc924479..97f8ae1a70 100644
--- a/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c
@@ -1440,8 +1440,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 	switch (family) {
 	case RTMDIO_838X_FAMILY_ID:
 		bus->name = "rtl838x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_838x_reset;
 		priv->read_sds_phy = rtmdio_838x_read_sds_phy;
 		priv->write_sds_phy = rtmdio_838x_write_sds_phy;
@@ -1452,8 +1450,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		break;
 	case RTMDIO_839X_FAMILY_ID:
 		bus->name = "rtl839x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_839x_reset;
 		priv->read_sds_phy = rtmdio_839x_read_sds_phy;
 		priv->write_sds_phy = rtmdio_839x_write_sds_phy;
@@ -1464,8 +1460,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		break;
 	case RTMDIO_930X_FAMILY_ID:
 		bus->name = "rtl930x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_930x_reset;
 		priv->read_sds_phy = rtmdio_930x_read_sds_phy;
 		priv->write_sds_phy = rtmdio_930x_write_sds_phy;
@@ -1476,8 +1470,6 @@ static int rtmdio_probe(struct platform_device *pdev)
 		break;
 	case RTMDIO_931X_FAMILY_ID:
 		bus->name = "rtl931x-eth-mdio";
-		bus->read = rtmdio_read;
-		bus->write = rtmdio_write;
 		bus->reset = rtmdio_931x_reset;
 		priv->read_sds_phy = rtsds_931x_read;
 		priv->write_sds_phy = rtsds_931x_write;
@@ -1487,6 +1479,9 @@ static int rtmdio_probe(struct platform_device *pdev)
 		priv->write_phy = rtmdio_931x_write_phy;
 		break;
 	}
+
+	bus->read = rtmdio_read;
+	bus->write = rtmdio_write;
 	bus->read_c45 = rtmdio_read_c45;
 	bus->write_c45 = rtmdio_write_c45;
 	bus->parent = dev;




More information about the lede-commits mailing list