History

net: dsa: bcm_sf2: Ensure correct sub-node is parsed

When the bcm_sf2 was converted into a proper platform device driver and used the new dsa_register_switch() interface, we would still be parsing the legacy DSA node that contained all the port information since the platform firmware has intentionally maintained backward and forward compatibility to client programs. Ensure that we do parse the correct node, which is "ports" per the revised DSA binding.

Florian Fainelli committed 6 years ago

Commit afa3b591 parent 7df0a6a1 file · +6 −1Browse files

Unified · Split

drivers/net/dsa/bcm_sf2.c+6−1
@@ -1079,6 +1079,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) · 1078 unmodified lines
10791079 const struct bcm_sf2_of_data *data;
10801080 struct b53_platform_data *pdata;
10811081 struct dsa_switch_ops *ops;
1082+ struct device_node *ports;
10821083 struct bcm_sf2_priv *priv;
10831084 struct b53_device *dev;
10841085 struct dsa_switch *ds;
@@ -1146,7 +1147,11 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) · 61 unmodified lines
11461147 set_bit(0, priv->cfp.used);
11471148 set_bit(0, priv->cfp.unique);
11481149
1149− bcm_sf2_identify_ports(priv, dn->child);
1150+ ports = of_find_node_by_name(dn, "ports");
1151+ if (ports) {
1152+ bcm_sf2_identify_ports(priv, ports);
1153+ of_node_put(ports);
1154+ }
11501155
11511156 priv->irq0 = irq_of_parse_and_map(dn, 0);
11521157 priv->irq1 = irq_of_parse_and_map(dn, 1);