aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-05-10 17:27:24 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-11 19:36:28 -0400
commitff04955c2f678a2c4c3207e0184c4c389da9d1e2 (patch)
treed21e3cc6db20f9c3ed39ef72166cba7de56bd69e /net/dsa
parentc33063d6a0d83a553faacf32f3cb834e63d8ecd7 (diff)
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>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa.c18
-rw-r--r--net/dsa/slave.c10
2 files changed, 14 insertions, 14 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 5db779c69a68..eff5dfc2e33f 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -182,7 +182,7 @@ __ATTRIBUTE_GROUPS(dsa_hwmon);
182/* basic switch operations **************************************************/ 182/* basic switch operations **************************************************/
183static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master) 183static 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 struct device_node *port_dn; 186 struct device_node *port_dn;
187 struct phy_device *phydev; 187 struct phy_device *phydev;
188 int ret, port, mode; 188 int ret, port, mode;
@@ -219,7 +219,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
219{ 219{
220 struct dsa_switch_driver *drv = ds->drv; 220 struct dsa_switch_driver *drv = ds->drv;
221 struct dsa_switch_tree *dst = ds->dst; 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 bool valid_name_found = false; 223 bool valid_name_found = false;
224 int index = ds->index; 224 int index = ds->index;
225 int i, ret; 225 int i, ret;
@@ -230,7 +230,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
230 for (i = 0; i < DSA_MAX_PORTS; i++) { 230 for (i = 0; i < DSA_MAX_PORTS; i++) {
231 char *name; 231 char *name;
232 232
233 name = pd->port_names[i]; 233 name = cd->port_names[i];
234 if (name == NULL) 234 if (name == NULL)
235 continue; 235 continue;
236 236
@@ -328,10 +328,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
328 if (!(ds->enabled_port_mask & (1 << i))) 328 if (!(ds->enabled_port_mask & (1 << i)))
329 continue; 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 if (ret < 0) { 332 if (ret < 0) {
333 netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n", 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 ret = 0; 335 ret = 0;
336 } 336 }
337 } 337 }
@@ -379,7 +379,7 @@ static struct dsa_switch *
379dsa_switch_setup(struct dsa_switch_tree *dst, int index, 379dsa_switch_setup(struct dsa_switch_tree *dst, int index,
380 struct device *parent, struct device *host_dev) 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 struct dsa_switch_driver *drv; 383 struct dsa_switch_driver *drv;
384 struct dsa_switch *ds; 384 struct dsa_switch *ds;
385 int ret; 385 int ret;
@@ -389,7 +389,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
389 /* 389 /*
390 * Probe for switch model. 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 if (drv == NULL) { 393 if (drv == NULL) {
394 netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n", 394 netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n",
395 index); 395 index);
@@ -408,7 +408,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
408 408
409 ds->dst = dst; 409 ds->dst = dst;
410 ds->index = index; 410 ds->index = index;
411 ds->pd = pd; 411 ds->cd = cd;
412 ds->drv = drv; 412 ds->drv = drv;
413 ds->priv = priv; 413 ds->priv = priv;
414 ds->dev = parent; 414 ds->dev = parent;
@@ -424,7 +424,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
424{ 424{
425 struct device_node *port_dn; 425 struct device_node *port_dn;
426 struct phy_device *phydev; 426 struct phy_device *phydev;
427 struct dsa_chip_data *cd = ds->pd; 427 struct dsa_chip_data *cd = ds->cd;
428 int port; 428 int port;
429 429
430#ifdef CONFIG_NET_DSA_HWMON 430#ifdef CONFIG_NET_DSA_HWMON
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index f25dcd9e814a..152436cdab30 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -50,7 +50,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
50 ds->slave_mii_bus->read = dsa_slave_phy_read; 50 ds->slave_mii_bus->read = dsa_slave_phy_read;
51 ds->slave_mii_bus->write = dsa_slave_phy_write; 51 ds->slave_mii_bus->write = dsa_slave_phy_write;
52 snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x", 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 ds->slave_mii_bus->parent = ds->dev; 54 ds->slave_mii_bus->parent = ds->dev;
55 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; 55 ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
56} 56}
@@ -615,8 +615,8 @@ static int dsa_slave_get_eeprom_len(struct net_device *dev)
615 struct dsa_slave_priv *p = netdev_priv(dev); 615 struct dsa_slave_priv *p = netdev_priv(dev);
616 struct dsa_switch *ds = p->parent; 616 struct dsa_switch *ds = p->parent;
617 617
618 if (ds->pd->eeprom_len) 618 if (ds->cd->eeprom_len)
619 return ds->pd->eeprom_len; 619 return ds->cd->eeprom_len;
620 620
621 if (ds->drv->get_eeprom_len) 621 if (ds->drv->get_eeprom_len)
622 return ds->drv->get_eeprom_len(ds); 622 return ds->drv->get_eeprom_len(ds);
@@ -999,7 +999,7 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p,
999 struct net_device *slave_dev) 999 struct net_device *slave_dev)
1000{ 1000{
1001 struct dsa_switch *ds = p->parent; 1001 struct dsa_switch *ds = p->parent;
1002 struct dsa_chip_data *cd = ds->pd; 1002 struct dsa_chip_data *cd = ds->cd;
1003 struct device_node *phy_dn, *port_dn; 1003 struct device_node *phy_dn, *port_dn;
1004 bool phy_is_fixed = false; 1004 bool phy_is_fixed = false;
1005 u32 phy_flags = 0; 1005 u32 phy_flags = 0;
@@ -1147,7 +1147,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
1147 NULL); 1147 NULL);
1148 1148
1149 SET_NETDEV_DEV(slave_dev, parent); 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 slave_dev->vlan_features = master->vlan_features; 1151 slave_dev->vlan_features = master->vlan_features;
1152 1152
1153 p = netdev_priv(slave_dev); 1153 p = netdev_priv(slave_dev);