Patchwork [U-Boot,V2,3/8] net/designware: Phy address fix

login
register
mail settings
Submitter Amit Virdi
Date March 26, 2012, 10:09 a.m.
Message ID <1332756599-19304-4-git-send-email-amit.virdi@st.com>
Download mbox | patch
Permalink /patch/148688/
State Accepted
Delegated to: Joe Hershberger
Headers show

Comments

Amit Virdi - March 26, 2012, 10:09 a.m.
From: Vipin KUMAR <vipin.kumar@st.com>

The code assumes the phy address to be > 0, which is not true, the phy address
can be in the range 0-31.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
---
 drivers/net/designware.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Amit Virdi - April 5, 2012, 5:15 a.m.
Hi Joe,

On 3/26/2012 3:39 PM, Amit VIRDI wrote:
> From: Vipin KUMAR<vipin.kumar@st.com>
>
> The code assumes the phy address to be>  0, which is not true, the phy address
> can be in the range 0-31.
>
> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
> Signed-off-by: Amit Virdi<amit.virdi@st.com>

Could you please confirm if you have applied this patch too?

Thanks n Best Regards
Amit Virdi
Joe Hershberger - April 5, 2012, 2:36 p.m.
Hi Amit,

On Thu, Apr 5, 2012 at 12:15 AM, Amit Virdi <amit.virdi@st.com> wrote:
> Hi Joe,
>
>
> On 3/26/2012 3:39 PM, Amit VIRDI wrote:
>>
>> From: Vipin KUMAR<vipin.kumar@st.com>
>>
>> The code assumes the phy address to be>  0, which is not true, the phy
>> address
>> can be in the range 0-31.
>>
>> Signed-off-by: Vipin Kumar<vipin.kumar@st.com>
>> Signed-off-by: Amit Virdi<amit.virdi@st.com>
>
>
> Could you please confirm if you have applied this patch too?

Yes... sorry... missed that one in the emails, but it is applied.

-Joe

Patch

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index ea8a406..fc14b70 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -384,7 +384,7 @@  static int configure_phy(struct eth_device *dev)
 
 #if defined(CONFIG_DW_SEARCH_PHY)
 	phy_addr = find_phy(dev);
-	if (phy_addr > 0)
+	if (phy_addr >= 0)
 		priv->address = phy_addr;
 	else
 		return -1;