diff options
author | imp <imp@FreeBSD.org> | 2008-08-23 07:46:20 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-08-23 07:46:20 +0000 |
commit | 8da6ff44f12c6b055dc2cada942143931c749c6f (patch) | |
tree | 42cdecf1532cbada31a0f2a92f29bf693feb1c40 /sys/dev | |
parent | b06e92ed2896a3c87c3d8a64f23c8a458d36feb0 (diff) | |
download | FreeBSD-src-8da6ff44f12c6b055dc2cada942143931c749c6f.zip FreeBSD-src-8da6ff44f12c6b055dc2cada942143931c749c6f.tar.gz |
Set devs to 0 in case device_get_children return an error. The right thing
to do here is nothing in that case...
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mii/mii.c | 1 | ||||
-rw-r--r-- | sys/dev/mii/mlphy.c | 2 | ||||
-rw-r--r-- | sys/dev/mii/tlphy.c | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 065bc5d..11610e9 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -339,6 +339,7 @@ mii_phy_probe(device_t dev, device_t *child, ifm_change_cb_t ifmedia_upd, for (i = 0; i < MII_NPHY; i++) { bmsr = MIIBUS_READREG(dev, i, MII_BMSR); + printf("BMSR(%d) is %#x\n", i, bmsr); if (bmsr == 0 || bmsr == 0xffff || (bmsr & (BMSR_EXTSTAT|BMSR_MEDIAMASK)) == 0) { /* Assume no PHY at this address. */ diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c index d0a549c..9eba9da 100644 --- a/sys/dev/mii/mlphy.c +++ b/sys/dev/mii/mlphy.c @@ -194,6 +194,7 @@ mlphy_service(xsc, mii, cmd) * See if there's another PHY on this bus with us. * If so, we may need it for 10Mbps modes. */ + devs = 0; device_get_children(msc->ml_mii.mii_dev, &devlist, &devs); for (i = 0; i < devs; i++) { if (strcmp(device_get_name(devlist[i]), "mlphy")) { @@ -400,6 +401,7 @@ mlphy_status(sc) int devs, i; /* See if there's another PHY on the bus with us. */ + devs = 0; device_get_children(msc->ml_mii.mii_dev, &devlist, &devs); for (i = 0; i < devs; i++) { if (strcmp(device_get_name(devlist[i]), "mlphy")) { diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c index d21fe7f..6a603c2 100644 --- a/sys/dev/mii/tlphy.c +++ b/sys/dev/mii/tlphy.c @@ -163,6 +163,7 @@ tlphy_attach(device_t dev) capmask = 0xFFFFFFFF; if (mii->mii_instance) { + devs = 0; device_get_children(sc->sc_mii.mii_dev, &devlist, &devs); for (i = 0; i < devs; i++) { if (strcmp(device_get_name(devlist[i]), "tlphy")) { |