netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macb: fix mdiobus_scan() error check
@ 2016-04-30 22:47 Sergei Shtylyov
  2016-05-01 16:03 ` Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2016-04-30 22:47 UTC (permalink / raw)
  To: netdev, nicolas.ferre

Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
device ID was read as all ones. As this was not  an error before, this
value  should be filtered out now in this driver.

Fixes: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against DaveM's 'net-next.git' repo.

 drivers/net/ethernet/cadence/macb.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: net-next/drivers/net/ethernet/cadence/macb.c
===================================================================
--- net-next.orig/drivers/net/ethernet/cadence/macb.c
+++ net-next/drivers/net/ethernet/cadence/macb.c
@@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp
 				struct phy_device *phydev;
 
 				phydev = mdiobus_scan(bp->mii_bus, i);
-				if (IS_ERR(phydev)) {
+				if (IS_ERR(phydev) &&
+				    PTR_ERR(phydev) != -ENODEV) {
 					err = PTR_ERR(phydev);
 					break;
 				}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] macb: fix mdiobus_scan() error check
  2016-04-30 22:47 [PATCH] macb: fix mdiobus_scan() error check Sergei Shtylyov
@ 2016-05-01 16:03 ` Florian Fainelli
  2016-05-02  7:39 ` Nicolas Ferre
  2016-05-03 19:04 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2016-05-01 16:03 UTC (permalink / raw)
  To: Sergei Shtylyov, netdev, nicolas.ferre

Le 30/04/2016 15:47, Sergei Shtylyov a écrit :
> Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
> device ID was read as all ones. As this was not  an error before, this
> value  should be filtered out now in this driver.
> 
> Fixes: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] macb: fix mdiobus_scan() error check
  2016-04-30 22:47 [PATCH] macb: fix mdiobus_scan() error check Sergei Shtylyov
  2016-05-01 16:03 ` Florian Fainelli
@ 2016-05-02  7:39 ` Nicolas Ferre
  2016-05-03 19:04 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2016-05-02  7:39 UTC (permalink / raw)
  To: Sergei Shtylyov, netdev, David Miller

Le 01/05/2016 00:47, Sergei Shtylyov a écrit :
> Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
> device ID was read as all ones. As this was not  an error before, this
> value  should be filtered out now in this driver.
> 
> Fixes: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks.

> 
> ---
> The patch is against DaveM's 'net-next.git' repo.
> 
>  drivers/net/ethernet/cadence/macb.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: net-next/drivers/net/ethernet/cadence/macb.c
> ===================================================================
> --- net-next.orig/drivers/net/ethernet/cadence/macb.c
> +++ net-next/drivers/net/ethernet/cadence/macb.c
> @@ -458,7 +458,8 @@ static int macb_mii_init(struct macb *bp
>  				struct phy_device *phydev;
>  
>  				phydev = mdiobus_scan(bp->mii_bus, i);
> -				if (IS_ERR(phydev)) {
> +				if (IS_ERR(phydev) &&
> +				    PTR_ERR(phydev) != -ENODEV) {
>  					err = PTR_ERR(phydev);
>  					break;
>  				}
> 
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] macb: fix mdiobus_scan() error check
  2016-04-30 22:47 [PATCH] macb: fix mdiobus_scan() error check Sergei Shtylyov
  2016-05-01 16:03 ` Florian Fainelli
  2016-05-02  7:39 ` Nicolas Ferre
@ 2016-05-03 19:04 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-05-03 19:04 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, nicolas.ferre

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 01 May 2016 01:47:36 +0300

> Now mdiobus_scan() returns ERR_PTR(-ENODEV) instead of NULL if the PHY
> device ID was read as all ones. As this was not  an error before, this
> value  should be filtered out now in this driver.
> 
> Fixes: b74766a0a0fe ("phylib: don't return NULL from get_phy_device()")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-03 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-30 22:47 [PATCH] macb: fix mdiobus_scan() error check Sergei Shtylyov
2016-05-01 16:03 ` Florian Fainelli
2016-05-02  7:39 ` Nicolas Ferre
2016-05-03 19:04 ` David Miller

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).