summaryrefslogtreecommitdiffstats
path: root/sys/dev/dc/if_dc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/dc/if_dc.c')
-rw-r--r--sys/dev/dc/if_dc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index a23706a..a07c4dc 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -1770,6 +1770,9 @@ static int dc_attach(dev)
unit = device_get_unit(dev);
bzero(sc, sizeof(struct dc_softc));
+ mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_DEF);
+ DC_LOCK(sc);
+
/*
* Handle power management nonsense.
*/
@@ -1833,8 +1836,6 @@ static int dc_attach(dev)
goto fail;
}
- mtx_init(&sc->dc_mtx, device_get_nameunit(dev), MTX_DEF);
- DC_LOCK(sc);
/* Need this info to decide on a chip type. */
sc->dc_info = dc_devtype(dev);
revision = pci_read_config(dev, DC_PCI_CFRV, 4) & 0x000000FF;
OpenPOWER on IntegriCloud