dsa: Remove master_dev from switch structure
authorAndrew Lunn <andrew@lunn.ch>
Tue, 10 May 2016 21:27:23 +0000 (23:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 May 2016 23:36:28 +0000 (19:36 -0400)
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>
drivers/net/dsa/mv88e6xxx.c
include/net/dsa.h
net/dsa/dsa.c
net/dsa/slave.c

index e7e07eb7091dc84218b0c6134db6cb909756dbe5..8659cbaac9f9c1c66c4d630fbe80a77393e19e79 100644 (file)
@@ -3642,6 +3642,7 @@ int mv88e6xxx_probe(struct mdio_device *mdiodev)
 
        ps = (struct mv88e6xxx_priv_state *)(ds + 1);
        ds->priv = ps;
+       ds->dev = dev;
        ps->dev = dev;
        ps->ds = ds;
        ps->bus = mdiodev->bus;
index ecb52e265cc3d30d2660e7f8c9737068c8e29bbc..f4c0bff8d9d64a47dc025d32f0be6f4454d3d3ec 100644 (file)
@@ -120,6 +120,8 @@ struct dsa_switch_tree {
 };
 
 struct dsa_switch {
+       struct device *dev;
+
        /*
         * Parent switch tree, and switch index.
         */
@@ -142,11 +144,6 @@ struct dsa_switch {
         */
        struct dsa_switch_driver        *drv;
 
-       /*
-        * Reference to host device to use.
-        */
-       struct device           *master_dev;
-
 #ifdef CONFIG_NET_DSA_HWMON
        /*
         * Hardware monitoring information
index df169811f26d70061610356c995b26baba02831b..5db779c69a680c455e3556a4236e08415a65613f 100644 (file)
@@ -411,7 +411,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
        ds->pd = pd;
        ds->drv = drv;
        ds->priv = priv;
-       ds->master_dev = host_dev;
+       ds->dev = parent;
 
        ret = dsa_switch_setup_one(ds, parent);
        if (ret)
index 5ea8a40c8d33da8a2964939eff38fbdbad98ea17..f25dcd9e814a1930b9221b3156c6068dc8c677eb 100644 (file)
@@ -51,7 +51,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
        ds->slave_mii_bus->write = dsa_slave_phy_write;
        snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x",
                        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;
 }