aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa2.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-01-26 13:45:51 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-26 15:43:52 -0500
commit55ed0ce0898e15fec30d2ca2a563d7934b082375 (patch)
tree16e0eb4137314defd4b06242a4ef47f315232b3c /net/dsa/dsa2.c
parent80c8eae6ee66b52e1304c9ffd02b4472d5976608 (diff)
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>
Diffstat (limited to 'net/dsa/dsa2.c')
-rw-r--r--net/dsa/dsa2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 866222a8f9bf..2cf489c5e90f 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -578,8 +578,9 @@ static struct device_node *dsa_get_ports(struct dsa_switch *ds,
578 return ports; 578 return ports;
579} 579}
580 580
581static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np) 581static int _dsa_register_switch(struct dsa_switch *ds, struct device *dev)
582{ 582{
583 struct device_node *np = dev->of_node;
583 struct device_node *ports = dsa_get_ports(ds, np); 584 struct device_node *ports = dsa_get_ports(ds, np);
584 struct dsa_switch_tree *dst; 585 struct dsa_switch_tree *dst;
585 u32 tree, index; 586 u32 tree, index;
@@ -659,12 +660,12 @@ out:
659 return err; 660 return err;
660} 661}
661 662
662int dsa_register_switch(struct dsa_switch *ds, struct device_node *np) 663int dsa_register_switch(struct dsa_switch *ds, struct device *dev)
663{ 664{
664 int err; 665 int err;
665 666
666 mutex_lock(&dsa2_mutex); 667 mutex_lock(&dsa2_mutex);
667 err = _dsa_register_switch(ds, np); 668 err = _dsa_register_switch(ds, dev);
668 mutex_unlock(&dsa2_mutex); 669 mutex_unlock(&dsa2_mutex);
669 670
670 return err; 671 return err;