net: dsa: Pass device pointer to dsa_register_switch

In preparation for allowing dsa_register_switch() to be supplied with
device/platform data, pass down a struct device pointer instead of a
struct device_node.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Florian Fainelli
2017-01-26 10:45:51 -08:00
committed by David S. Miller
parent 80c8eae6ee
commit 55ed0ce089
5 changed files with 10 additions and 10 deletions

View File

@@ -578,8 +578,9 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds,
return ports;
}
static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
{
struct device_node *np = dev->of_node;
struct device_node *ports = dsa_get_ports(ds, np);
struct dsa_switch_tree *dst;
u32 tree, index;
@@ -659,12 +660,12 @@ out:
return err;
}
int dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
int dsa_register_switch(struct dsa_switch *ds, struct device *dev)
{
int err;
mutex_lock(&dsa2_mutex);
err = _dsa_register_switch(ds, np);
err = _dsa_register_switch(ds, dev);
mutex_unlock(&dsa2_mutex);
return err;