diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-12-25 03:51:25 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-12-25 03:51:25 +0000 |
commit | 36539f666d235a275e6f1f5aafd8ba883b1262d0 (patch) | |
tree | b501bb796e708a5cae5b678a8884f889998cfd59 | |
parent | 8c69a6a497f8e5d94c159b64b6768bb4dd4b7045 (diff) |
- remove unneccessary break
- reorder operations and a few return (0)'s to break's with MII_TICK switch case
-rw-r--r-- | sys/dev/mii/dcphy.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c index 0b68c91cc8b..6bdf017a2a6 100644 --- a/sys/dev/mii/dcphy.c +++ b/sys/dev/mii/dcphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dcphy.c,v 1.11 2004/11/16 14:26:22 brad Exp $ */ +/* $OpenBSD: dcphy.c,v 1.12 2004/12/25 03:51:24 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -260,7 +260,6 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) break; default: return(EINVAL); - break; } break; @@ -272,20 +271,20 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) return (0); /* - * Only used for autonegotiation. + * Is the interface even up? */ - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) + if ((mii->mii_ifp->if_flags & IFF_UP) == 0) return (0); /* - * Is the interface even up? + * Only used for autonegotiation. */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); + if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) + break; reg = CSR_READ_4(dc_sc, DC_10BTSTAT); if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100)) - return (0); + break; /* * Only retry autonegotiation every 5 seconds. @@ -301,8 +300,7 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) break; sc->mii_ticks = 0; - /*if (DC_IS_INTEL(dc_sc))*/ - sc->mii_flags &= ~MIIF_DOINGAUTO; + sc->mii_flags &= ~MIIF_DOINGAUTO; dcphy_auto(sc, 0); break; |