Browse Source

dsa: Remove master_dev from switch structure

The switch drivers only use the master_dev member for dev_info()
messages.  Now that the device is passed to the old style probe, and
new style drivers are probed as true linux drivers, this is no longer
needed.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Andrew Lunn 9 years ago
parent
commit
c33063d6a0
4 changed files with 5 additions and 7 deletions
  1. 1 0
      drivers/net/dsa/mv88e6xxx.c
  2. 2 5
      include/net/dsa.h
  3. 1 1
      net/dsa/dsa.c
  4. 1 1
      net/dsa/slave.c

+ 1 - 0
drivers/net/dsa/mv88e6xxx.c

@@ -3642,6 +3642,7 @@ int mv88e6xxx_probe(struct mdio_device *mdiodev)
 
 
 	ps = (struct mv88e6xxx_priv_state *)(ds + 1);
 	ps = (struct mv88e6xxx_priv_state *)(ds + 1);
 	ds->priv = ps;
 	ds->priv = ps;
+	ds->dev = dev;
 	ps->dev = dev;
 	ps->dev = dev;
 	ps->ds = ds;
 	ps->ds = ds;
 	ps->bus = mdiodev->bus;
 	ps->bus = mdiodev->bus;

+ 2 - 5
include/net/dsa.h

@@ -120,6 +120,8 @@ struct dsa_switch_tree {
 };
 };
 
 
 struct dsa_switch {
 struct dsa_switch {
+	struct device *dev;
+
 	/*
 	/*
 	 * Parent switch tree, and switch index.
 	 * Parent switch tree, and switch index.
 	 */
 	 */
@@ -142,11 +144,6 @@ struct dsa_switch {
 	 */
 	 */
 	struct dsa_switch_driver	*drv;
 	struct dsa_switch_driver	*drv;
 
 
-	/*
-	 * Reference to host device to use.
-	 */
-	struct device		*master_dev;
-
 #ifdef CONFIG_NET_DSA_HWMON
 #ifdef CONFIG_NET_DSA_HWMON
 	/*
 	/*
 	 * Hardware monitoring information
 	 * Hardware monitoring information

+ 1 - 1
net/dsa/dsa.c

@@ -411,7 +411,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
 	ds->pd = pd;
 	ds->pd = pd;
 	ds->drv = drv;
 	ds->drv = drv;
 	ds->priv = priv;
 	ds->priv = priv;
-	ds->master_dev = host_dev;
+	ds->dev = parent;
 
 
 	ret = dsa_switch_setup_one(ds, parent);
 	ret = dsa_switch_setup_one(ds, parent);
 	if (ret)
 	if (ret)

+ 1 - 1
net/dsa/slave.c

@@ -51,7 +51,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
 	ds->slave_mii_bus->write = dsa_slave_phy_write;
 	ds->slave_mii_bus->write = dsa_slave_phy_write;
 	snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x",
 	snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x",
 			ds->index, ds->pd->sw_addr);
 			ds->index, ds->pd->sw_addr);
-	ds->slave_mii_bus->parent = ds->master_dev;
+	ds->slave_mii_bus->parent = ds->dev;
 	ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
 	ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
 }
 }