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
1079 const struct bcm_sf2_of_data *data;1079 const struct bcm_sf2_of_data *data;
1080 struct b53_platform_data *pdata;1080 struct b53_platform_data *pdata;
1081 struct dsa_switch_ops *ops;1081 struct dsa_switch_ops *ops;
1082 struct device_node *ports;
1082 struct bcm_sf2_priv *priv;1083 struct bcm_sf2_priv *priv;
1083 struct b53_device *dev;1084 struct b53_device *dev;
1084 struct dsa_switch *ds;1085 struct dsa_switch *ds;
@@ -1146,7 +1147,11 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) · 61 unmodified lines
1146 set_bit(0, priv->cfp.used);1147 set_bit(0, priv->cfp.used);
1147 set_bit(0, priv->cfp.unique);1148 set_bit(0, priv->cfp.unique);
1148 1149
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 }
1150 1155
1151 priv->irq0 = irq_of_parse_and_map(dn, 0);1156 priv->irq0 = irq_of_parse_and_map(dn, 0);
1152 priv->irq1 = irq_of_parse_and_map(dn, 1);1157 priv->irq1 = irq_of_parse_and_map(dn, 1);