Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andrew Lunn and committed by
David S. Miller
ff04955c c33063d6

+20 -20
+2 -2
drivers/net/dsa/bcm_sf2.c
··· 949 949 /* All the interesting properties are at the parent device_node 950 950 * level 951 951 */ 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); 954 954 955 955 priv->irq0 = irq_of_parse_and_map(dn, 0); 956 956 priv->irq1 = irq_of_parse_and_map(dn, 1);
+2 -2
drivers/net/dsa/mv88e6xxx.c
··· 3023 3023 for (i = 0; i < 32; i++) { 3024 3024 int nexthop = 0x1f; 3025 3025 3026 - if (ps->ds->pd->rtable && 3026 + if (ps->ds->cd->rtable && 3027 3027 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; 3029 3029 3030 3030 err = _mv88e6xxx_reg_write( 3031 3031 ps, REG_GLOBAL2,
+2 -2
include/net/dsa.h
··· 137 137 /* 138 138 * Configuration data for this switch. 139 139 */ 140 - struct dsa_chip_data *pd; 140 + struct dsa_chip_data *cd; 141 141 142 142 /* 143 143 * The used switch driver. ··· 190 190 if (dst->cpu_switch == ds->index) 191 191 return dst->cpu_port; 192 192 else 193 - return ds->pd->rtable[dst->cpu_switch]; 193 + return ds->cd->rtable[dst->cpu_switch]; 194 194 } 195 195 196 196 struct switchdev_trans;
+9 -9
net/dsa/dsa.c
··· 182 182 /* basic switch operations **************************************************/ 183 183 static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master) 184 184 { 185 - struct dsa_chip_data *cd = ds->pd; 185 + struct dsa_chip_data *cd = ds->cd; 186 186 struct device_node *port_dn; 187 187 struct phy_device *phydev; 188 188 int ret, port, mode; ··· 219 219 { 220 220 struct dsa_switch_driver *drv = ds->drv; 221 221 struct dsa_switch_tree *dst = ds->dst; 222 - struct dsa_chip_data *pd = ds->pd; 222 + struct dsa_chip_data *cd = ds->cd; 223 223 bool valid_name_found = false; 224 224 int index = ds->index; 225 225 int i, ret; ··· 230 230 for (i = 0; i < DSA_MAX_PORTS; i++) { 231 231 char *name; 232 232 233 - name = pd->port_names[i]; 233 + name = cd->port_names[i]; 234 234 if (name == NULL) 235 235 continue; 236 236 ··· 328 328 if (!(ds->enabled_port_mask & (1 << i))) 329 329 continue; 330 330 331 - ret = dsa_slave_create(ds, parent, i, pd->port_names[i]); 331 + ret = dsa_slave_create(ds, parent, i, cd->port_names[i]); 332 332 if (ret < 0) { 333 333 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); 335 335 ret = 0; 336 336 } 337 337 } ··· 379 379 dsa_switch_setup(struct dsa_switch_tree *dst, int index, 380 380 struct device *parent, struct device *host_dev) 381 381 { 382 - struct dsa_chip_data *pd = dst->pd->chip + index; 382 + struct dsa_chip_data *cd = dst->pd->chip + index; 383 383 struct dsa_switch_driver *drv; 384 384 struct dsa_switch *ds; 385 385 int ret; ··· 389 389 /* 390 390 * Probe for switch model. 391 391 */ 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); 393 393 if (drv == NULL) { 394 394 netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n", 395 395 index); ··· 408 408 409 409 ds->dst = dst; 410 410 ds->index = index; 411 - ds->pd = pd; 411 + ds->cd = cd; 412 412 ds->drv = drv; 413 413 ds->priv = priv; 414 414 ds->dev = parent; ··· 424 424 { 425 425 struct device_node *port_dn; 426 426 struct phy_device *phydev; 427 - struct dsa_chip_data *cd = ds->pd; 427 + struct dsa_chip_data *cd = ds->cd; 428 428 int port; 429 429 430 430 #ifdef CONFIG_NET_DSA_HWMON
+5 -5
net/dsa/slave.c
··· 50 50 ds->slave_mii_bus->read = dsa_slave_phy_read; 51 51 ds->slave_mii_bus->write = dsa_slave_phy_write; 52 52 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); 54 54 ds->slave_mii_bus->parent = ds->dev; 55 55 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; 56 56 } ··· 615 615 struct dsa_slave_priv *p = netdev_priv(dev); 616 616 struct dsa_switch *ds = p->parent; 617 617 618 - if (ds->pd->eeprom_len) 619 - return ds->pd->eeprom_len; 618 + if (ds->cd->eeprom_len) 619 + return ds->cd->eeprom_len; 620 620 621 621 if (ds->drv->get_eeprom_len) 622 622 return ds->drv->get_eeprom_len(ds); ··· 999 999 struct net_device *slave_dev) 1000 1000 { 1001 1001 struct dsa_switch *ds = p->parent; 1002 - struct dsa_chip_data *cd = ds->pd; 1002 + struct dsa_chip_data *cd = ds->cd; 1003 1003 struct device_node *phy_dn, *port_dn; 1004 1004 bool phy_is_fixed = false; 1005 1005 u32 phy_flags = 0; ··· 1147 1147 NULL); 1148 1148 1149 1149 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]; 1151 1151 slave_dev->vlan_features = master->vlan_features; 1152 1152 1153 1153 p = netdev_priv(slave_dev);