Skip to content

Commit 46e7b8d

Browse files
viviendavem330
authored andcommitted
net: dsa: kill circular reference with slave priv
The dsa_slave_priv structure does not need a pointer to its net_device. Kill it. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9f4ab6e commit 46e7b8d

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

net/dsa/dsa_priv.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ struct dsa_device_ops {
2222
};
2323

2424
struct dsa_slave_priv {
25-
/*
26-
* The linux network interface corresponding to this
27-
* switch port.
28-
*/
29-
struct net_device *dev;
3025
struct sk_buff * (*xmit)(struct sk_buff *skb,
3126
struct net_device *dev);
3227

net/dsa/slave.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,10 @@ static void dsa_slave_get_ethtool_stats(struct net_device *dev,
673673
struct dsa_slave_priv *p = netdev_priv(dev);
674674
struct dsa_switch *ds = p->parent;
675675

676-
data[0] = p->dev->stats.tx_packets;
677-
data[1] = p->dev->stats.tx_bytes;
678-
data[2] = p->dev->stats.rx_packets;
679-
data[3] = p->dev->stats.rx_bytes;
676+
data[0] = dev->stats.tx_packets;
677+
data[1] = dev->stats.tx_bytes;
678+
data[2] = dev->stats.rx_packets;
679+
data[3] = dev->stats.rx_bytes;
680680
if (ds->drv->get_ethtool_stats != NULL)
681681
ds->drv->get_ethtool_stats(ds, p->port, data + 4);
682682
}
@@ -1063,7 +1063,6 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
10631063
slave_dev->vlan_features = master->vlan_features;
10641064

10651065
p = netdev_priv(slave_dev);
1066-
p->dev = slave_dev;
10671066
p->parent = ds;
10681067
p->port = port;
10691068

0 commit comments

Comments
 (0)