Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bce7ce18 authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit afa3b592953bfaecfb4f2f335ec5f935cff56804 ]

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: d9338023 ("net: dsa: bcm_sf2: Make it a real platform device driver")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 040f7a27
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1053,6 +1053,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
	const struct bcm_sf2_of_data *data;
	const struct bcm_sf2_of_data *data;
	struct b53_platform_data *pdata;
	struct b53_platform_data *pdata;
	struct dsa_switch_ops *ops;
	struct dsa_switch_ops *ops;
	struct device_node *ports;
	struct bcm_sf2_priv *priv;
	struct bcm_sf2_priv *priv;
	struct b53_device *dev;
	struct b53_device *dev;
	struct dsa_switch *ds;
	struct dsa_switch *ds;
@@ -1115,7 +1116,11 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
	set_bit(0, priv->cfp.used);
	set_bit(0, priv->cfp.used);
	set_bit(0, priv->cfp.unique);
	set_bit(0, priv->cfp.unique);


	bcm_sf2_identify_ports(priv, dn->child);
	ports = of_find_node_by_name(dn, "ports");
	if (ports) {
		bcm_sf2_identify_ports(priv, ports);
		of_node_put(ports);
	}


	priv->irq0 = irq_of_parse_and_map(dn, 0);
	priv->irq0 = irq_of_parse_and_map(dn, 0);
	priv->irq1 = irq_of_parse_and_map(dn, 1);
	priv->irq1 = irq_of_parse_and_map(dn, 1);