Skip to content

Commit ff04955

Browse files
lunndavem330
authored andcommitted
dsa: Rename switch chip data to cd
The dsa_switch structure contains a dsa_chip_data member called pd. However in the rest of the code, pd is used for dsa_platform_data. This is confusing. Rename it cd, which is already often used in dsa.c and slave.c for this data type. Signed-off-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c33063d commit ff04955

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

drivers/net/dsa/bcm_sf2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,8 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
949949
/* All the interesting properties are at the parent device_node
950950
* level
951951
*/
952-
dn = ds->pd->of_node->parent;
953-
bcm_sf2_identify_ports(priv, ds->pd->of_node);
952+
dn = ds->cd->of_node->parent;
953+
bcm_sf2_identify_ports(priv, ds->cd->of_node);
954954

955955
priv->irq0 = irq_of_parse_and_map(dn, 0);
956956
priv->irq1 = irq_of_parse_and_map(dn, 1);

drivers/net/dsa/mv88e6xxx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3023,9 +3023,9 @@ static int mv88e6xxx_setup_global(struct mv88e6xxx_priv_state *ps)
30233023
for (i = 0; i < 32; i++) {
30243024
int nexthop = 0x1f;
30253025

3026-
if (ps->ds->pd->rtable &&
3026+
if (ps->ds->cd->rtable &&
30273027
i != ps->ds->index && i < ps->ds->dst->pd->nr_chips)
3028-
nexthop = ps->ds->pd->rtable[i] & 0x1f;
3028+
nexthop = ps->ds->cd->rtable[i] & 0x1f;
30293029

30303030
err = _mv88e6xxx_reg_write(
30313031
ps, REG_GLOBAL2,

include/net/dsa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct dsa_switch {
137137
/*
138138
* Configuration data for this switch.
139139
*/
140-
struct dsa_chip_data *pd;
140+
struct dsa_chip_data *cd;
141141

142142
/*
143143
* The used switch driver.
@@ -190,7 +190,7 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
190190
if (dst->cpu_switch == ds->index)
191191
return dst->cpu_port;
192192
else
193-
return ds->pd->rtable[dst->cpu_switch];
193+
return ds->cd->rtable[dst->cpu_switch];
194194
}
195195

196196
struct switchdev_trans;

net/dsa/dsa.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ __ATTRIBUTE_GROUPS(dsa_hwmon);
182182
/* basic switch operations **************************************************/
183183
static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master)
184184
{
185-
struct dsa_chip_data *cd = ds->pd;
185+
struct dsa_chip_data *cd = ds->cd;
186186
struct device_node *port_dn;
187187
struct phy_device *phydev;
188188
int ret, port, mode;
@@ -219,7 +219,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
219219
{
220220
struct dsa_switch_driver *drv = ds->drv;
221221
struct dsa_switch_tree *dst = ds->dst;
222-
struct dsa_chip_data *pd = ds->pd;
222+
struct dsa_chip_data *cd = ds->cd;
223223
bool valid_name_found = false;
224224
int index = ds->index;
225225
int i, ret;
@@ -230,7 +230,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
230230
for (i = 0; i < DSA_MAX_PORTS; i++) {
231231
char *name;
232232

233-
name = pd->port_names[i];
233+
name = cd->port_names[i];
234234
if (name == NULL)
235235
continue;
236236

@@ -328,10 +328,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
328328
if (!(ds->enabled_port_mask & (1 << i)))
329329
continue;
330330

331-
ret = dsa_slave_create(ds, parent, i, pd->port_names[i]);
331+
ret = dsa_slave_create(ds, parent, i, cd->port_names[i]);
332332
if (ret < 0) {
333333
netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
334-
index, i, pd->port_names[i], ret);
334+
index, i, cd->port_names[i], ret);
335335
ret = 0;
336336
}
337337
}
@@ -379,7 +379,7 @@ static struct dsa_switch *
379379
dsa_switch_setup(struct dsa_switch_tree *dst, int index,
380380
struct device *parent, struct device *host_dev)
381381
{
382-
struct dsa_chip_data *pd = dst->pd->chip + index;
382+
struct dsa_chip_data *cd = dst->pd->chip + index;
383383
struct dsa_switch_driver *drv;
384384
struct dsa_switch *ds;
385385
int ret;
@@ -389,7 +389,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
389389
/*
390390
* Probe for switch model.
391391
*/
392-
drv = dsa_switch_probe(parent, host_dev, pd->sw_addr, &name, &priv);
392+
drv = dsa_switch_probe(parent, host_dev, cd->sw_addr, &name, &priv);
393393
if (drv == NULL) {
394394
netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n",
395395
index);
@@ -408,7 +408,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
408408

409409
ds->dst = dst;
410410
ds->index = index;
411-
ds->pd = pd;
411+
ds->cd = cd;
412412
ds->drv = drv;
413413
ds->priv = priv;
414414
ds->dev = parent;
@@ -424,7 +424,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
424424
{
425425
struct device_node *port_dn;
426426
struct phy_device *phydev;
427-
struct dsa_chip_data *cd = ds->pd;
427+
struct dsa_chip_data *cd = ds->cd;
428428
int port;
429429

430430
#ifdef CONFIG_NET_DSA_HWMON

net/dsa/slave.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
5050
ds->slave_mii_bus->read = dsa_slave_phy_read;
5151
ds->slave_mii_bus->write = dsa_slave_phy_write;
5252
snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x",
53-
ds->index, ds->pd->sw_addr);
53+
ds->index, ds->cd->sw_addr);
5454
ds->slave_mii_bus->parent = ds->dev;
5555
ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
5656
}
@@ -615,8 +615,8 @@ static int dsa_slave_get_eeprom_len(struct net_device *dev)
615615
struct dsa_slave_priv *p = netdev_priv(dev);
616616
struct dsa_switch *ds = p->parent;
617617

618-
if (ds->pd->eeprom_len)
619-
return ds->pd->eeprom_len;
618+
if (ds->cd->eeprom_len)
619+
return ds->cd->eeprom_len;
620620

621621
if (ds->drv->get_eeprom_len)
622622
return ds->drv->get_eeprom_len(ds);
@@ -999,7 +999,7 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p,
999999
struct net_device *slave_dev)
10001000
{
10011001
struct dsa_switch *ds = p->parent;
1002-
struct dsa_chip_data *cd = ds->pd;
1002+
struct dsa_chip_data *cd = ds->cd;
10031003
struct device_node *phy_dn, *port_dn;
10041004
bool phy_is_fixed = false;
10051005
u32 phy_flags = 0;
@@ -1147,7 +1147,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
11471147
NULL);
11481148

11491149
SET_NETDEV_DEV(slave_dev, parent);
1150-
slave_dev->dev.of_node = ds->pd->port_dn[port];
1150+
slave_dev->dev.of_node = ds->cd->port_dn[port];
11511151
slave_dev->vlan_features = master->vlan_features;
11521152

11531153
p = netdev_priv(slave_dev);

0 commit comments

Comments
 (0)