diff --git a/target/linux/realtek/dts/rtl838x.dtsi b/target/linux/realtek/dts/rtl838x.dtsi index 64e1e26e297..1ee9c46212f 100644 --- a/target/linux/realtek/dts/rtl838x.dtsi +++ b/target/linux/realtek/dts/rtl838x.dtsi @@ -199,9 +199,11 @@ }; }; - switchcore@1b000000 { - compatible = "syscon", "simple-mfd"; + switch0: ethernet-switch@1b000000 { + compatible = "realtek,rtl8380-switch", "realtek,otto-switch", "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + interrupt-parent = <&intc>; + interrupts = <20 2>; #address-cells = <1>; #size-cells = <1>; @@ -280,14 +282,6 @@ compatible = "realtek,rtl8380-thermal"; #thermal-sensor-cells = <0>; }; - - switch0: ethernet-switch { - compatible = "realtek,rtl8380-switch", "realtek,otto-switch"; - status = "okay"; - - interrupt-parent = <&intc>; - interrupts = <20 2>; - }; }; pinmux@1b000144 { diff --git a/target/linux/realtek/dts/rtl839x.dtsi b/target/linux/realtek/dts/rtl839x.dtsi index 4ed1af9d053..0a31019dbff 100644 --- a/target/linux/realtek/dts/rtl839x.dtsi +++ b/target/linux/realtek/dts/rtl839x.dtsi @@ -207,9 +207,11 @@ }; - switchcore@1b000000 { - compatible = "syscon", "simple-mfd"; + switch0: ethernet-switch@1b000000 { + compatible = "realtek,rtl8392-switch", "realtek,otto-switch", "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + interrupt-parent = <&intc>; + interrupts = <20 2>; #address-cells = <1>; #size-cells = <1>; @@ -325,14 +327,6 @@ compatible = "realtek,rtl8390-thermal"; #thermal-sensor-cells = <0>; }; - - switch0: ethernet-switch { - compatible = "realtek,rtl8392-switch", "realtek,otto-switch"; - status = "okay"; - - interrupt-parent = <&intc>; - interrupts = <20 2>; - }; }; pinmux@1b000004 { diff --git a/target/linux/realtek/dts/rtl930x.dtsi b/target/linux/realtek/dts/rtl930x.dtsi index 2e5d9eb6523..10507b1d389 100644 --- a/target/linux/realtek/dts/rtl930x.dtsi +++ b/target/linux/realtek/dts/rtl930x.dtsi @@ -167,9 +167,11 @@ }; - switchcore@1b000000 { - compatible = "syscon", "simple-mfd"; + switch0: ethernet-switch@1b000000 { + compatible = "realtek,rtl9301-switch", "realtek,otto-switch", "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + interrupt-parent = <&intc>; + interrupts = <23 2>; #address-cells = <1>; #size-cells = <1>; @@ -304,14 +306,6 @@ compatible = "realtek,rtl9300-thermal"; #thermal-sensor-cells = <0>; }; - - switch0: ethernet-switch { - compatible = "realtek,rtl9301-switch", "realtek,otto-switch"; - status = "okay"; - - interrupt-parent = <&intc>; - interrupts = <23 2>; - }; }; pinmux@1b000200 { diff --git a/target/linux/realtek/dts/rtl931x.dtsi b/target/linux/realtek/dts/rtl931x.dtsi index 95448ae6fef..a26bfc6d554 100644 --- a/target/linux/realtek/dts/rtl931x.dtsi +++ b/target/linux/realtek/dts/rtl931x.dtsi @@ -194,9 +194,12 @@ }; }; - switchcore@1b000000 { - compatible = "syscon", "simple-mfd"; + switch0: ethernet-switch@1b000000 { + compatible = "realtek,rtl9311-switch", "realtek,otto-switch", "syscon", "simple-mfd"; reg = <0x1b000000 0x10000>; + interrupt-parent = <&gic>; + interrupts = ; + #interrupt-cells = <3>; #address-cells = <1>; #size-cells = <1>; @@ -339,15 +342,6 @@ #pcs-cells = <1>; }; }; - - switch0: ethernet-switch { - compatible = "realtek,rtl9311-switch", "realtek,otto-switch"; - status = "okay"; - - interrupt-parent = <&gic>; - #interrupt-cells = <3>; - interrupts = ; - }; }; pinmux@1b00103c { 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 6888f86eba1..c4d425b7847 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 @@ -976,14 +976,9 @@ static int rtmd_map_ports(struct device *dev) struct rtmd_ctrl *ctrl = dev_get_drvdata(dev); int smi_bus, smi_addr, pn; - struct fwnode_handle *fw_parent __free(fwnode_handle) = fwnode_get_parent(fw_dev); - if (!fw_parent) - return -ENODEV; - - struct fwnode_handle *fw_switch __free(fwnode_handle) = - fwnode_get_named_child_node(fw_parent, "ethernet-switch"); + struct fwnode_handle *fw_switch __free(fwnode_handle) = fwnode_get_parent(fw_dev); if (!fw_switch) - return dev_err_probe(dev, -ENODEV, "%pfwP missing ethernet-switch\n", fw_parent); + return -ENODEV; struct fwnode_handle *fw_ports __free(fwnode_handle) = fwnode_get_named_child_node(fw_switch, "ethernet-ports"); diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index ea1c445289f..b48d7900901 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -4247,14 +4247,9 @@ static struct rtpcs_serdes *rtpcs_find_serdes(struct rtpcs_ctrl *ctrl, static int rtpcs_map_links(struct device *dev, struct rtpcs_ctrl *ctrl) { struct fwnode_handle *fw_dev = dev_fwnode(dev); - struct fwnode_handle *fw_parent __free(fwnode_handle) = fwnode_get_parent(fw_dev); - if (!fw_parent) - return -ENODEV; - - struct fwnode_handle *fw_switch __free(fwnode_handle) = - fwnode_get_named_child_node(fw_parent, "ethernet-switch"); + struct fwnode_handle *fw_switch __free(fwnode_handle) = fwnode_get_parent(fw_dev); if (!fw_switch) - return dev_err_probe(dev, -ENODEV, "%pfwP missing ethernet-switch\n", fw_parent); + return -ENODEV; struct fwnode_handle *fw_ports __free(fwnode_handle) = fwnode_get_named_child_node(fw_switch, "ethernet-ports");