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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Nov 2013 15:05:56 +0000
From:	Srinivas Kandagatla <srinivas.kandagatla@...com>
To:	<devicetree@...r.kernel.org>
Cc:	Grant Likely <grant.likely@...aro.org>,
	Rob Herring <rob.herring@...xeda.com>,
	<linux-kernel@...r.kernel.org>, <srinivas.kandagatla@...com>
Subject: [PATCH RFC] net: of_mdio: Scan PHYs which have device_type set to ethernet-phy

According to Documentation/devicetree/bindings/net/phy.txt device_type
property of PHY nodes is mandatory, which should be set to
"ethernet-phy". This patch adds check in scanning phys and only scans
node which have device-type set to "ethernet-phy".

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...com>
---
 drivers/of/of_mdio.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
index d5a57a9..78c53c7 100644
--- a/drivers/of/of_mdio.c
+++ b/drivers/of/of_mdio.c
@@ -57,6 +57,9 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 
 	/* Loop over the child nodes and register a phy_device for each one */
 	for_each_available_child_of_node(np, child) {
+		/* A PHY must have device_type set to "ethernet-phy" */
+		if (of_node_cmp(child->type, "ethernet-phy"))
+			continue;
 		/* A PHY must have a reg property in the range [0-31] */
 		paddr = of_get_property(child, "reg", &len);
 		if (!paddr || len < sizeof(*paddr)) {
@@ -112,6 +115,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 
 	/* auto scan for PHYs with empty reg property */
 	for_each_available_child_of_node(np, child) {
+		/* A PHY must have device_type set to "ethernet-phy" */
+		if (of_node_cmp(child->type, "ethernet-phy"))
+			continue;
+
 		/* Skip PHYs with reg property set */
 		paddr = of_get_property(child, "reg", &len);
 		if (paddr)
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ