From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH RFC] net: of_mdio: Scan PHYs which have device_type set to ethernet-phy Date: Wed, 11 Dec 2013 07:15:54 +0000 Message-ID: <1695129.4QIGmmVPkX@lenovo> References: <1384441556-20674-1-git-send-email-srinivas.kandagatla@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: devicetree@vger.kernel.org, Grant Likely , Rob Herring , linux-kernel@vger.kernel.org, netdev@vger.kernel.org To: Srinivas Kandagatla Return-path: In-Reply-To: <1384441556-20674-1-git-send-email-srinivas.kandagatla@st.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Le jeudi 14 novembre 2013, 15:05:56 Srinivas Kandagatla a =E9crit : > According to Documentation/devicetree/bindings/net/phy.txt device_typ= e > 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". Please CC netdev@vger.kernel.org as there might be networking folks not= =20 actively following devicetree-discuss. >=20 > Signed-off-by: Srinivas Kandagatla > --- > drivers/of/of_mdio.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) >=20 > 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, struc= t > device_node *np) >=20 > /* 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; As already stated by Grant this will break quite a lot of platforms out= there.=20 Technically speaking, ePAPR v1.1 only specifies that "cpu" and "memory"= nodes=20 should have a "device_type" property for compatibility. Altough I do ag= ree=20 that it is nice to have a properly set "device_type", we can't always r= ely on=20 that.=20 --=20 =46lorian