Skip to content

Commit c33063d

Browse files
lunndavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 52638f7 commit c33063d

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

drivers/net/dsa/mv88e6xxx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,7 @@ int mv88e6xxx_probe(struct mdio_device *mdiodev)
36423642

36433643
ps = (struct mv88e6xxx_priv_state *)(ds + 1);
36443644
ds->priv = ps;
3645+
ds->dev = dev;
36453646
ps->dev = dev;
36463647
ps->ds = ds;
36473648
ps->bus = mdiodev->bus;

include/net/dsa.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ struct dsa_switch_tree {
120120
};
121121

122122
struct dsa_switch {
123+
struct device *dev;
124+
123125
/*
124126
* Parent switch tree, and switch index.
125127
*/
@@ -142,11 +144,6 @@ struct dsa_switch {
142144
*/
143145
struct dsa_switch_driver *drv;
144146

145-
/*
146-
* Reference to host device to use.
147-
*/
148-
struct device *master_dev;
149-
150147
#ifdef CONFIG_NET_DSA_HWMON
151148
/*
152149
* Hardware monitoring information

net/dsa/dsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
411411
ds->pd = pd;
412412
ds->drv = drv;
413413
ds->priv = priv;
414-
ds->master_dev = host_dev;
414+
ds->dev = parent;
415415

416416
ret = dsa_switch_setup_one(ds, parent);
417417
if (ret)

net/dsa/slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
5151
ds->slave_mii_bus->write = dsa_slave_phy_write;
5252
snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x",
5353
ds->index, ds->pd->sw_addr);
54-
ds->slave_mii_bus->parent = ds->master_dev;
54+
ds->slave_mii_bus->parent = ds->dev;
5555
ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
5656
}
5757

0 commit comments

Comments
 (0)