Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/marvell Check wheter an MII PHY is really connected ...



details:   https://anonhg.NetBSD.org/src/rev/913fa77d563e
branches:  trunk
changeset: 783425:913fa77d563e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Dec 20 10:01:28 2012 +0000

description:
Check wheter an MII PHY is really connected or not.
This change privents panic if MII PHY port is not used.

diffstat:

 sys/dev/marvell/if_mvgbe.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 9ac35099542f -r 913fa77d563e sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c        Thu Dec 20 08:03:41 2012 +0000
+++ b/sys/dev/marvell/if_mvgbe.c        Thu Dec 20 10:01:28 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mvgbe.c,v 1.32 2012/11/09 09:04:19 msaitoh Exp $    */
+/*     $NetBSD: if_mvgbe.c,v 1.33 2012/12/20 10:01:28 msaitoh Exp $    */
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.32 2012/11/09 09:04:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.33 2012/12/20 10:01:28 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -429,7 +429,9 @@
                        if (child) {
                                port = device_private(child);
                                mii  = LIST_FIRST(&port->sc_mii.mii_phys);
-                               phyaddr |= MVGBE_PHYADDR_PHYAD(j, mii->mii_phy);
+                               if (mii != NULL)
+                                       phyaddr |= MVGBE_PHYADDR_PHYAD(j,
+                                           mii->mii_phy);
                        }
                }
                break;



Home | Main Index | Thread Index | Old Index