Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/marvell don't abuse cf_unit, requested by phone.
details: https://anonhg.NetBSD.org/src/rev/1b566b67dd63
branches: trunk
changeset: 762951:1b566b67dd63
user: christos <christos%NetBSD.org@localhost>
date: Sun Mar 06 17:00:16 2011 +0000
description:
don't abuse cf_unit, requested by phone.
diffstat:
sys/dev/marvell/if_mvgbe.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diffs (53 lines):
diff -r 106fe234613b -r 1b566b67dd63 sys/dev/marvell/if_mvgbe.c
--- a/sys/dev/marvell/if_mvgbe.c Sun Mar 06 16:00:20 2011 +0000
+++ b/sys/dev/marvell/if_mvgbe.c Sun Mar 06 17:00:16 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mvgbe.c,v 1.6 2011/03/05 18:28:13 christos Exp $ */
+/* $NetBSD: if_mvgbe.c,v 1.7 2011/03/06 17:00:16 christos 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.6 2011/03/05 18:28:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.7 2011/03/06 17:00:16 christos Exp $");
#include "rnd.h"
@@ -184,7 +184,6 @@
struct mvgbec_softc {
device_t sc_dev;
- int sc_unit;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
@@ -355,16 +354,14 @@
sc->sc_dev = self;
sc->sc_iot = mva->mva_iot;
- sc->sc_unit = mva->mva_unit;
if (bus_space_subregion(mva->mva_iot, mva->mva_ioh, mva->mva_offset,
mva->mva_size, &sc->sc_ioh)) {
aprint_error_dev(self, "Cannot map registers\n");
return;
}
- if (sc->sc_unit == 0) {
+ if (mvgbec0 == NULL)
mvgbec0 = self;
- }
phyaddr = 0;
MVGBE_WRITE(sc, MVGBE_PHYADDR, phyaddr);
@@ -770,7 +767,7 @@
ifmedia_init(&sc->sc_mii.mii_media, 0,
mvgbe_mediachange, mvgbe_mediastatus);
mii_attach(self, &sc->sc_mii, 0xffffffff,
- csc->sc_unit, MII_OFFSET_ANY, 0);
+ parent == mvgebc0 ? 0 : 1, MII_OFFSET_ANY, 0);
if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
aprint_error_dev(self, "no PHY found!\n");
ifmedia_add(&sc->sc_mii.mii_media,
Home |
Main Index |
Thread Index |
Old Index