linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/cadence/macb: fix kernel Oops if no PHY were discovered during probe
@ 2013-08-24 19:21 Boris BREZILLON
  2013-08-26  7:43 ` Nicolas Ferre
  2013-08-26  9:09 ` Bo Shen
  0 siblings, 2 replies; 4+ messages in thread
From: Boris BREZILLON @ 2013-08-24 19:21 UTC (permalink / raw)
  To: linux-arm-kernel

Test the presence of a PHY device before printing attached PHY
informations.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 drivers/net/ethernet/cadence/macb.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index e866608..fd3b67f 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1868,8 +1868,10 @@ static int __init macb_probe(struct platform_device *pdev)
 		    dev->irq, dev->dev_addr);
 
 	phydev = bp->phy_dev;
-	netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
-		    phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
+	if (phydev)
+		netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
+			    phydev->drv->name, dev_name(&phydev->dev),
+			    phydev->irq);
 
 	return 0;
 
-- 
1.7.9.5

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

end of thread, other threads:[~2013-08-26 12:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-24 19:21 [PATCH] net/cadence/macb: fix kernel Oops if no PHY were discovered during probe Boris BREZILLON
2013-08-26  7:43 ` Nicolas Ferre
2013-08-26  9:09 ` Bo Shen
2013-08-26 12:01   ` boris brezillon

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