lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  3 Jun 2016 17:05:21 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	netdev@...r.kernel.org
Cc:	davem@...emloft.net, andrew@...n.ch,
	vivien.didelot@...oirfairelinux.com, john@...ozen.org,
	Florian Fainelli <f.fainelli@...il.com>
Subject: [PATCH net-next 1/9] net: dsa: Prepare to support legacy DT binding

In preparation for supporting the legacy DT binding, call
dsa_get_ports() early on to allow two different parsing code paths to be
called.

Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
 net/dsa/dsa2.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 4e5051bed643..b5640d8ffbae 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -552,7 +552,7 @@ 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_node *np)
 {
 	struct device_node *ports = dsa_get_ports(ds, np);
 	struct dsa_switch_tree *dst;
@@ -622,6 +622,16 @@ out:
 	return err;
 }
 
+static int _dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
+{
+	struct device_node *ports = dsa_get_ports(ds, np);
+
+	if (IS_ERR(ports))
+		return PTR_ERR(ports);
+
+	return __dsa_register_switch(ds, np);
+}
+
 int dsa_register_switch(struct dsa_switch *ds, struct device_node *np)
 {
 	int err;
-- 
2.7.4

Powered by blists - more mailing lists