Skip to content

Commit afa3b59

Browse files
ffainellidavem330
authored andcommitted
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. Fixes: d933802 ("net: dsa: bcm_sf2: Make it a real platform device driver") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Vivien Didelot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7df0a6a commit afa3b59

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/dsa/bcm_sf2.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
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)
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);

0 commit comments

Comments
 (0)