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