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

Commit b95db668 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'dsa2-pdata-prepatory-patches'



Florian Fainelli says:

====================
net: dsa: Preparatory patches

This patch series extracts the 4 patches of the larger: net: dsa: Support for
pdata in dsa2 while we wait for feedback from Greg KH on the device references.

Changes in v2:

- rebased properly after the multi-MDIO bus support added to mv88e6xxx
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 80c8eae6 bc1727d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1894,7 +1894,7 @@ int b53_switch_register(struct b53_device *dev)

	pr_info("found switch: %s, rev %i\n", dev->name, dev->core_rev);

	return dsa_register_switch(dev->ds, dev->ds->dev->of_node);
	return dsa_register_switch(dev->ds, dev->ds->dev);
}
EXPORT_SYMBOL(b53_switch_register);

+3 −4
Original line number Diff line number Diff line
@@ -4356,8 +4356,7 @@ static struct dsa_switch_driver mv88e6xxx_switch_drv = {
	.ops			= &mv88e6xxx_switch_ops,
};

static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip,
				     struct device_node *np)
static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
{
	struct device *dev = chip->dev;
	struct dsa_switch *ds;
@@ -4372,7 +4371,7 @@ static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip,

	dev_set_drvdata(dev, ds);

	return dsa_register_switch(ds, np);
	return dsa_register_switch(ds, dev);
}

static void mv88e6xxx_unregister_switch(struct mv88e6xxx_chip *chip)
@@ -4456,7 +4455,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
	if (err)
		goto out_g2_irq;

	err = mv88e6xxx_register_switch(chip, np);
	err = mv88e6xxx_register_switch(chip);
	if (err)
		goto out_mdio;

+1 −1
Original line number Diff line number Diff line
@@ -964,7 +964,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
	mutex_init(&priv->reg_mutex);
	dev_set_drvdata(&mdiodev->dev, priv);

	return dsa_register_switch(priv->ds, priv->ds->dev->of_node);
	return dsa_register_switch(priv->ds, &mdiodev->dev);
}

static void
+1 −1
Original line number Diff line number Diff line
@@ -387,7 +387,7 @@ static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
}

void dsa_unregister_switch(struct dsa_switch *ds);
int dsa_register_switch(struct dsa_switch *ds, struct device_node *np);
int dsa_register_switch(struct dsa_switch *ds, struct device *dev);
#ifdef CONFIG_PM_SLEEP
int dsa_switch_suspend(struct dsa_switch *ds);
int dsa_switch_resume(struct dsa_switch *ds);
+9 −6
Original line number Diff line number Diff line
@@ -110,8 +110,9 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,

/* basic switch operations **************************************************/
int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,
		      struct device_node *port_dn, int port)
		      struct dsa_port *dport, int port)
{
	struct device_node *port_dn = dport->dn;
	struct phy_device *phydev;
	int ret, mode;

@@ -141,15 +142,15 @@ int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,

static int dsa_cpu_dsa_setups(struct dsa_switch *ds, struct device *dev)
{
	struct device_node *port_dn;
	struct dsa_port *dport;
	int ret, port;

	for (port = 0; port < DSA_MAX_PORTS; port++) {
		if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
			continue;

		port_dn = ds->ports[port].dn;
		ret = dsa_cpu_dsa_setup(ds, dev, port_dn, port);
		dport = &ds->ports[port];
		ret = dsa_cpu_dsa_setup(ds, dev, dport, port);
		if (ret)
			return ret;
	}
@@ -364,8 +365,10 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
	return ds;
}

void dsa_cpu_dsa_destroy(struct device_node *port_dn)
void dsa_cpu_dsa_destroy(struct dsa_port *port)
{
	struct device_node *port_dn = port->dn;

	if (of_phy_is_fixed_link(port_dn))
		of_phy_deregister_fixed_link(port_dn);
}
@@ -389,7 +392,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
	for (port = 0; port < DSA_MAX_PORTS; port++) {
		if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
			continue;
		dsa_cpu_dsa_destroy(ds->ports[port].dn);
		dsa_cpu_dsa_destroy(&ds->ports[port]);

		/* Clearing a bit which is not set does no harm */
		ds->cpu_port_mask |= ~(1 << port);
Loading