* [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property.
@ 2009-04-27 15:36 Grant Likely
  2009-04-27 17:36 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2009-04-27 15:36 UTC (permalink / raw)
  To: Joakim Tjernlund, Andy Fleming, Benjamin Herrenschmidt,
	David Miller, linuxppc-dev, netdev
From: Grant Likely <grant.likely@secretlab.ca>
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.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/net/ucc_geth.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 195b490..d805d60 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -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];
^ permalink raw reply related	[flat|nested] 5+ messages in thread
* Re: [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property.
  2009-04-27 15:36 [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property Grant Likely
@ 2009-04-27 17:36 ` Scott Wood
  2009-04-27 17:50   ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2009-04-27 17:36 UTC (permalink / raw)
  To: Grant Likely
  Cc: Joakim Tjernlund, linuxppc-dev, Andy Fleming, netdev,
	David Miller
On Mon, Apr 27, 2009 at 09:36:13AM -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> 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]
>  	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
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property.
  2009-04-27 17:36 ` Scott Wood
@ 2009-04-27 17:50   ` Grant Likely
  2009-04-28  9:12     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2009-04-27 17:50 UTC (permalink / raw)
  To: Scott Wood
  Cc: Joakim Tjernlund, linuxppc-dev, Andy Fleming, netdev,
	David Miller
On Mon, Apr 27, 2009 at 11:36 AM, Scott Wood <scottwood@freescale.com> wrot=
e:
> On Mon, Apr 27, 2009 at 09:36:13AM -0600, Grant Likely wrote:
>> From: Grant Likely <grant.likely@secretlab.ca>
>>
>> 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. =A0This patch removes the offending blurb.
> [snip]
>> =A0 =A0 =A0 prop =3D of_get_property(np, "phy-connection-type", NULL);
>> =A0 =A0 =A0 if (!prop) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* handle interface property present in old =
trees */
>> - =A0 =A0 =A0 =A0 =A0 =A0 if (!phy)
>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
>> -
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop =3D of_get_property(phy, "interface", N=
ULL);
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop !=3D NULL) {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 phy_interface =3D enet_to_ph=
y_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). =A0I 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.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property.
  2009-04-27 17:50   ` Grant Likely
@ 2009-04-28  9:12     ` David Miller
  2009-04-28 13:37       ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2009-04-28  9:12 UTC (permalink / raw)
  To: grant.likely; +Cc: Joakim.Tjernlund, linuxppc-dev, afleming, netdev, scottwood
From: Grant Likely <grant.likely@secretlab.ca>
Date: Mon, 27 Apr 2009 11:50:20 -0600
> On Mon, Apr 27, 2009 at 11:36 AM, Scott Wood <scottwood@freescale.com=
> wrote:
>> On Mon, Apr 27, 2009 at 09:36:13AM -0600, Grant Likely wrote:
>>> From: Grant Likely <grant.likely@secretlab.ca>
>>>
>>> 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. =A0This patch removes the offending bl=
urb.
>> [snip]
>>> =A0 =A0 =A0 prop =3D of_get_property(np, "phy-connection-type", NUL=
L);
>>> =A0 =A0 =A0 if (!prop) {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* handle interface property present in=
 old trees */
>>> - =A0 =A0 =A0 =A0 =A0 =A0 if (!phy)
>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
>>> -
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop =3D of_get_property(phy, "interfac=
e", NULL);
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop !=3D NULL) {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 phy_interface =3D 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). =A0I can see it breaking fixed lin=
k
>> 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.
^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property.
  2009-04-28  9:12     ` David Miller
@ 2009-04-28 13:37       ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2009-04-28 13:37 UTC (permalink / raw)
  To: David Miller; +Cc: Joakim.Tjernlund, linuxppc-dev, afleming, netdev, scottwood
On Tue, Apr 28, 2009 at 3:12 AM, David Miller <davem@davemloft.net> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> Date: Mon, 27 Apr 2009 11:50:20 -0600
>
>> On Mon, Apr 27, 2009 at 11:36 AM, Scott Wood <scottwood@freescale.com> w=
rote:
>>> On Mon, Apr 27, 2009 at 09:36:13AM -0600, Grant Likely wrote:
>>>> From: Grant Likely <grant.likely@secretlab.ca>
>>>>
>>>> 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. =A0This patch removes the offending blurb=
.
>>> [snip]
>>>> =A0 =A0 =A0 prop =3D of_get_property(np, "phy-connection-type", NULL);
>>>> =A0 =A0 =A0 if (!prop) {
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* handle interface property present in ol=
d trees */
>>>> - =A0 =A0 =A0 =A0 =A0 =A0 if (!phy)
>>>> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -ENODEV;
>>>> -
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 prop =3D of_get_property(phy, "interface",=
 NULL);
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (prop !=3D NULL) {
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 phy_interface =3D 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). =A0I can see it breaking fixed link
>>> device trees, though.
>>
>> Sorry, you're right. =A0I got myself confused when I was writing the
>> description. =A0This 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.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply	[flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-28 13:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 15:36 [PATCH] net: Fix ucc_geth.c handling of phy 'interface' property Grant Likely
2009-04-27 17:36 ` Scott Wood
2009-04-27 17:50   ` Grant Likely
2009-04-28  9:12     ` David Miller
2009-04-28 13:37       ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).