Commit ff04955c authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

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: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c33063d6
...@@ -949,8 +949,8 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds) ...@@ -949,8 +949,8 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)
/* All the interesting properties are at the parent device_node /* All the interesting properties are at the parent device_node
* level * level
*/ */
dn = ds->pd->of_node->parent; dn = ds->cd->of_node->parent;
bcm_sf2_identify_ports(priv, ds->pd->of_node); bcm_sf2_identify_ports(priv, ds->cd->of_node);
priv->irq0 = irq_of_parse_and_map(dn, 0); priv->irq0 = irq_of_parse_and_map(dn, 0);
priv->irq1 = irq_of_parse_and_map(dn, 1); priv->irq1 = irq_of_parse_and_map(dn, 1);
......
...@@ -3023,9 +3023,9 @@ static int mv88e6xxx_setup_global(struct mv88e6xxx_priv_state *ps) ...@@ -3023,9 +3023,9 @@ static int mv88e6xxx_setup_global(struct mv88e6xxx_priv_state *ps)
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
int nexthop = 0x1f; int nexthop = 0x1f;
if (ps->ds->pd->rtable && if (ps->ds->cd->rtable &&
i != ps->ds->index && i < ps->ds->dst->pd->nr_chips) i != ps->ds->index && i < ps->ds->dst->pd->nr_chips)
nexthop = ps->ds->pd->rtable[i] & 0x1f; nexthop = ps->ds->cd->rtable[i] & 0x1f;
err = _mv88e6xxx_reg_write( err = _mv88e6xxx_reg_write(
ps, REG_GLOBAL2, ps, REG_GLOBAL2,
......
...@@ -137,7 +137,7 @@ struct dsa_switch { ...@@ -137,7 +137,7 @@ struct dsa_switch {
/* /*
* Configuration data for this switch. * Configuration data for this switch.
*/ */
struct dsa_chip_data *pd; struct dsa_chip_data *cd;
/* /*
* The used switch driver. * The used switch driver.
...@@ -190,7 +190,7 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds) ...@@ -190,7 +190,7 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
if (dst->cpu_switch == ds->index) if (dst->cpu_switch == ds->index)
return dst->cpu_port; return dst->cpu_port;
else else
return ds->pd->rtable[dst->cpu_switch]; return ds->cd->rtable[dst->cpu_switch];
} }
struct switchdev_trans; struct switchdev_trans;
......
...@@ -182,7 +182,7 @@ __ATTRIBUTE_GROUPS(dsa_hwmon); ...@@ -182,7 +182,7 @@ __ATTRIBUTE_GROUPS(dsa_hwmon);
/* basic switch operations **************************************************/ /* basic switch operations **************************************************/
static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master) static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master)
{ {
struct dsa_chip_data *cd = ds->pd; struct dsa_chip_data *cd = ds->cd;
struct device_node *port_dn; struct device_node *port_dn;
struct phy_device *phydev; struct phy_device *phydev;
int ret, port, mode; int ret, port, mode;
...@@ -219,7 +219,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) ...@@ -219,7 +219,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
{ {
struct dsa_switch_driver *drv = ds->drv; struct dsa_switch_driver *drv = ds->drv;
struct dsa_switch_tree *dst = ds->dst; struct dsa_switch_tree *dst = ds->dst;
struct dsa_chip_data *pd = ds->pd; struct dsa_chip_data *cd = ds->cd;
bool valid_name_found = false; bool valid_name_found = false;
int index = ds->index; int index = ds->index;
int i, ret; int i, ret;
...@@ -230,7 +230,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) ...@@ -230,7 +230,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
for (i = 0; i < DSA_MAX_PORTS; i++) { for (i = 0; i < DSA_MAX_PORTS; i++) {
char *name; char *name;
name = pd->port_names[i]; name = cd->port_names[i];
if (name == NULL) if (name == NULL)
continue; continue;
...@@ -328,10 +328,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) ...@@ -328,10 +328,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
if (!(ds->enabled_port_mask & (1 << i))) if (!(ds->enabled_port_mask & (1 << i)))
continue; continue;
ret = dsa_slave_create(ds, parent, i, pd->port_names[i]); ret = dsa_slave_create(ds, parent, i, cd->port_names[i]);
if (ret < 0) { if (ret < 0) {
netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n", netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n",
index, i, pd->port_names[i], ret); index, i, cd->port_names[i], ret);
ret = 0; ret = 0;
} }
} }
...@@ -379,7 +379,7 @@ static struct dsa_switch * ...@@ -379,7 +379,7 @@ static struct dsa_switch *
dsa_switch_setup(struct dsa_switch_tree *dst, int index, dsa_switch_setup(struct dsa_switch_tree *dst, int index,
struct device *parent, struct device *host_dev) struct device *parent, struct device *host_dev)
{ {
struct dsa_chip_data *pd = dst->pd->chip + index; struct dsa_chip_data *cd = dst->pd->chip + index;
struct dsa_switch_driver *drv; struct dsa_switch_driver *drv;
struct dsa_switch *ds; struct dsa_switch *ds;
int ret; int ret;
...@@ -389,7 +389,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, ...@@ -389,7 +389,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
/* /*
* Probe for switch model. * Probe for switch model.
*/ */
drv = dsa_switch_probe(parent, host_dev, pd->sw_addr, &name, &priv); drv = dsa_switch_probe(parent, host_dev, cd->sw_addr, &name, &priv);
if (drv == NULL) { if (drv == NULL) {
netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n", netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n",
index); index);
...@@ -408,7 +408,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, ...@@ -408,7 +408,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
ds->dst = dst; ds->dst = dst;
ds->index = index; ds->index = index;
ds->pd = pd; ds->cd = cd;
ds->drv = drv; ds->drv = drv;
ds->priv = priv; ds->priv = priv;
ds->dev = parent; ds->dev = parent;
...@@ -424,7 +424,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds) ...@@ -424,7 +424,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
{ {
struct device_node *port_dn; struct device_node *port_dn;
struct phy_device *phydev; struct phy_device *phydev;
struct dsa_chip_data *cd = ds->pd; struct dsa_chip_data *cd = ds->cd;
int port; int port;
#ifdef CONFIG_NET_DSA_HWMON #ifdef CONFIG_NET_DSA_HWMON
......
...@@ -50,7 +50,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds) ...@@ -50,7 +50,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
ds->slave_mii_bus->read = dsa_slave_phy_read; ds->slave_mii_bus->read = dsa_slave_phy_read;
ds->slave_mii_bus->write = dsa_slave_phy_write; ds->slave_mii_bus->write = dsa_slave_phy_write;
snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x", snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "dsa-%d:%.2x",
ds->index, ds->pd->sw_addr); ds->index, ds->cd->sw_addr);
ds->slave_mii_bus->parent = ds->dev; ds->slave_mii_bus->parent = ds->dev;
ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask; ds->slave_mii_bus->phy_mask = ~ds->phys_mii_mask;
} }
...@@ -615,8 +615,8 @@ static int dsa_slave_get_eeprom_len(struct net_device *dev) ...@@ -615,8 +615,8 @@ static int dsa_slave_get_eeprom_len(struct net_device *dev)
struct dsa_slave_priv *p = netdev_priv(dev); struct dsa_slave_priv *p = netdev_priv(dev);
struct dsa_switch *ds = p->parent; struct dsa_switch *ds = p->parent;
if (ds->pd->eeprom_len) if (ds->cd->eeprom_len)
return ds->pd->eeprom_len; return ds->cd->eeprom_len;
if (ds->drv->get_eeprom_len) if (ds->drv->get_eeprom_len)
return ds->drv->get_eeprom_len(ds); return ds->drv->get_eeprom_len(ds);
...@@ -999,7 +999,7 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p, ...@@ -999,7 +999,7 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p,
struct net_device *slave_dev) struct net_device *slave_dev)
{ {
struct dsa_switch *ds = p->parent; struct dsa_switch *ds = p->parent;
struct dsa_chip_data *cd = ds->pd; struct dsa_chip_data *cd = ds->cd;
struct device_node *phy_dn, *port_dn; struct device_node *phy_dn, *port_dn;
bool phy_is_fixed = false; bool phy_is_fixed = false;
u32 phy_flags = 0; u32 phy_flags = 0;
...@@ -1147,7 +1147,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent, ...@@ -1147,7 +1147,7 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
NULL); NULL);
SET_NETDEV_DEV(slave_dev, parent); SET_NETDEV_DEV(slave_dev, parent);
slave_dev->dev.of_node = ds->pd->port_dn[port]; slave_dev->dev.of_node = ds->cd->port_dn[port];
slave_dev->vlan_features = master->vlan_features; slave_dev->vlan_features = master->vlan_features;
p = netdev_priv(slave_dev); p = netdev_priv(slave_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment