Skip to content

Commit 3fb1c9c

Browse files
plappermaulrobimarko
authored andcommitted
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 <[email protected]> Link: openwrt/openwrt#21274 Signed-off-by: Robert Marko <[email protected]>
1 parent 89f5678 commit 3fb1c9c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,8 +1440,6 @@ static int rtmdio_probe(struct platform_device *pdev)
14401440
switch (family) {
14411441
case RTMDIO_838X_FAMILY_ID:
14421442
bus->name = "rtl838x-eth-mdio";
1443-
bus->read = rtmdio_read;
1444-
bus->write = rtmdio_write;
14451443
bus->reset = rtmdio_838x_reset;
14461444
priv->read_sds_phy = rtmdio_838x_read_sds_phy;
14471445
priv->write_sds_phy = rtmdio_838x_write_sds_phy;
@@ -1452,8 +1450,6 @@ static int rtmdio_probe(struct platform_device *pdev)
14521450
break;
14531451
case RTMDIO_839X_FAMILY_ID:
14541452
bus->name = "rtl839x-eth-mdio";
1455-
bus->read = rtmdio_read;
1456-
bus->write = rtmdio_write;
14571453
bus->reset = rtmdio_839x_reset;
14581454
priv->read_sds_phy = rtmdio_839x_read_sds_phy;
14591455
priv->write_sds_phy = rtmdio_839x_write_sds_phy;
@@ -1464,8 +1460,6 @@ static int rtmdio_probe(struct platform_device *pdev)
14641460
break;
14651461
case RTMDIO_930X_FAMILY_ID:
14661462
bus->name = "rtl930x-eth-mdio";
1467-
bus->read = rtmdio_read;
1468-
bus->write = rtmdio_write;
14691463
bus->reset = rtmdio_930x_reset;
14701464
priv->read_sds_phy = rtmdio_930x_read_sds_phy;
14711465
priv->write_sds_phy = rtmdio_930x_write_sds_phy;
@@ -1476,8 +1470,6 @@ static int rtmdio_probe(struct platform_device *pdev)
14761470
break;
14771471
case RTMDIO_931X_FAMILY_ID:
14781472
bus->name = "rtl931x-eth-mdio";
1479-
bus->read = rtmdio_read;
1480-
bus->write = rtmdio_write;
14811473
bus->reset = rtmdio_931x_reset;
14821474
priv->read_sds_phy = rtsds_931x_read;
14831475
priv->write_sds_phy = rtsds_931x_write;
@@ -1487,6 +1479,9 @@ static int rtmdio_probe(struct platform_device *pdev)
14871479
priv->write_phy = rtmdio_931x_write_phy;
14881480
break;
14891481
}
1482+
1483+
bus->read = rtmdio_read;
1484+
bus->write = rtmdio_write;
14901485
bus->read_c45 = rtmdio_read_c45;
14911486
bus->write_c45 = rtmdio_write_c45;
14921487
bus->parent = dev;

0 commit comments

Comments
 (0)