Commit bd47497a authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: retain a per-port device_node pointer

We will later use the per-port device_node pointer to fetch a bunch of
port-specific properties.
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa981d9a
......@@ -41,6 +41,7 @@ struct dsa_chip_data {
* or any other string to indicate this is a physical port.
*/
char *port_names[DSA_MAX_PORTS];
struct device_node *port_dn[DSA_MAX_PORTS];
/*
* An array (with nr_chips elements) of which element [a]
......
......@@ -432,6 +432,8 @@ static int dsa_of_probe(struct platform_device *pdev)
if (!port_name)
continue;
cd->port_dn[port_index] = port;
cd->port_names[port_index] = kstrdup(port_name,
GFP_KERNEL);
if (!cd->port_names[port_index]) {
......
......@@ -354,6 +354,7 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
}
SET_NETDEV_DEV(slave_dev, parent);
slave_dev->dev.of_node = ds->pd->port_dn[port];
slave_dev->vlan_features = master->vlan_features;
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