Skip to contentSkip to conversation

net: Fix ucc_geth.c handling of phy 'interface' property.

PATCH In review Grant Likely 3 participants 5 messages Apr 27, 2009 – Apr 28, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Fix ucc_geth.c handling of phy 'interface' property.

From: Grant Likely <[email protected]>

Previous rework to ucc_geth.c to add of_mdio support (net: Rework ucc_geth driver to use of_mdio infrastructure) added a block of code which broke older openfirmware device trees which use an 'interface' property in the phy node to describe the connection between the MAC and the PHY. This patch removes the offending blurb.

---

 drivers/net/ucc_geth.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/net/ucc_geth.c +0 -3
index 195b490..d805d60 100644
@@ -3639,9 +3639,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 	prop = of_get_property(np, "phy-connection-type", NULL);
 	if (!prop) {
 		/* handle interface property present in old trees */
-		if (!phy)
-			return -ENODEV;
-
 		prop = of_get_property(phy, "interface", NULL);
 		if (prop != NULL) {
 			phy_interface = enet_to_phy_interface[*prop];
#1 lore raw
Quoted 7 lines · Grant Likely

From: Grant Likely <[email protected]>

Previous rework to ucc_geth.c to add of_mdio support (net: Rework ucc_geth driver to use of_mdio infrastructure) added a block of code which broke older openfirmware device trees which use an 'interface' property in the phy node to describe the connection between the MAC and the PHY. This patch removes the offending blurb.

[snip]

drivers/net/ucc_geth.c static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma · line 3644

Quoted 9 lines
drivers/net/ucc_geth.c +0 -3
 	prop = of_get_property(np, "phy-connection-type", NULL);
 	if (!prop) {
 		/* handle interface property present in old trees */
-		if (!phy)
-			return -ENODEV;
-
 		prop = of_get_property(phy, "interface", NULL);
 		if (prop != NULL) {
 			phy_interface = enet_to_phy_interface[*prop];

The above test only makes a difference when there is no phy node -- so I don't see how it was breaking device trees that had a phy node (with or without an "interface" property). I can see it breaking fixed link device trees, though.

-Scott

#2 lore raw
Quoted 19 lines · Scott Wood
Quoted 7 lines · Grant Likely

From: Grant Likely <[email protected]>

Previous rework to ucc_geth.c to add of_mdio support (net: Rework ucc_geth driver to use of_mdio infrastructure) added a block of code which broke older openfirmware device trees which use an 'interface' property in the phy node to describe the connection between the MAC and the PHY.  This patch removes the offending blurb.

[snip]

Quoted 9 lines

      prop = of_get_property(np, "phy-connection-type", NULL); if (!prop) {
              /* handle interface property present in old trees */
-             if (!phy)
-                     return -ENODEV;
-
              prop = of_get_property(phy, "interface", NULL); if (prop != NULL) {
                      phy_interface = enet_to_phy_interface[*prop];

Quoted 4 lines

The above test only makes a difference when there is no phy node -- so I don't see how it was breaking device trees that had a phy node (with or without an "interface" property).  I can see it breaking fixed link device trees, though.

Sorry, you're right. I got myself confused when I was writing the description. This patch fixes breakage when using a fixed-link and there is no phy-connection-type property.

g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
maintainer
#3 lore raw

From: Grant Likely <[email protected]>
Date: Mon, 27 Apr 2009 11:50:20 -0600

Quoted 20 lines · Scott Wood
Quoted 19 lines · Grant Likely
Quoted 7 lines

From: Grant Likely <[email protected]>

Previous rework to ucc_geth.c to add of_mdio support (net: Rework ucc_geth driver to use of_mdio infrastructure) added a block of code which broke older openfirmware device trees which use an 'interface' property in the phy node to describe the connection between the MAC and the PHY.  This patch removes the offending blurb.

[snip]

Quoted 9 lines

      prop = of_get_property(np, "phy-connection-type", NULL); if (!prop) {
              /* handle interface property present in old trees */
-             if (!phy)
-                     return -ENODEV;
-
              prop = of_get_property(phy, "interface", NULL); if (prop != NULL) {
                      phy_interface = enet_to_phy_interface[*prop];

Quoted 8 lines
Quoted 4 lines

The above test only makes a difference when there is no phy node -- so I don't see how it was breaking device trees that had a phy node (with or without an "interface" property).  I can see it breaking fixed link device trees, though.

Sorry, you're right. I got myself confused when I was writing the description. This patch fixes breakage when using a fixed-link and there is no phy-connection-type property.

Patch applied with commit message fixed up.

#4 lore raw
Quoted 28 lines · David Miller

From: Grant Likely <[email protected]>
Date: Mon, 27 Apr 2009 11:50:20 -0600

Quoted 25 lines · Scott Wood
Quoted 23 lines · Grant Likely
Quoted 7 lines

From: Grant Likely <[email protected]>

Previous rework to ucc_geth.c to add of_mdio support (net: Rework ucc_geth driver to use of_mdio infrastructure) added a block of code which broke older openfirmware device trees which use an 'interface' property in the phy node to describe the connection between the MAC and the PHY.  This patch removes the offending blurb.

[snip]

Quoted 9 lines

      prop = of_get_property(np, "phy-connection-type", NULL); if (!prop) {
              /* handle interface property present in old trees */
-             if (!phy)
-                     return -ENODEV;
-
              prop = of_get_property(phy, "interface", NULL); if (prop != NULL) {
                      phy_interface = enet_to_phy_interface[*prop];

The above test only makes a difference when there is no phy node -- so I don't see how it was breaking device trees that had a phy node (with or without an "interface" property).  I can see it breaking fixed link device trees, though.

Quoted 5 lines
Quoted 3 lines

Sorry, you're right.  I got myself confused when I was writing the description.  This patch fixes breakage when using a fixed-link and there is no phy-connection-type property.

Patch applied with commit message fixed up.

Thanks David

g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.