summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_pcn.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-08-17 17:44:58 +0000
committerjhb <jhb@FreeBSD.org>2005-08-17 17:44:58 +0000
commita4568a681a955ac44e06582271278340c6c64d59 (patch)
tree829906162ab41a92d939b7c8f49b469ea4a4d0e3 /sys/pci/if_pcn.c
parentdd48b0ad7c3a4439d849fd6a235da746148027e1 (diff)
downloadFreeBSD-src-a4568a681a955ac44e06582271278340c6c64d59.zip
FreeBSD-src-a4568a681a955ac44e06582271278340c6c64d59.tar.gz
Use callout_init_mtx() to simplify the stats callout.
MFC after: 3 days
Diffstat (limited to 'sys/pci/if_pcn.c')
-rw-r--r--sys/pci/if_pcn.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index 1dea7f4..30ee8d1 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -588,7 +588,7 @@ pcn_attach(dev)
eaddr[1] = CSR_READ_4(sc, PCN_IO32_APROM01);
sc->pcn_unit = unit;
- callout_init(&sc->pcn_stat_callout, CALLOUT_MPSAFE);
+ callout_init_mtx(&sc->pcn_stat_callout, &sc->pcn_mtx, 0);
sc->pcn_ldata = contigmalloc(sizeof(struct pcn_list_data), M_DEVBUF,
M_NOWAIT, 0, 0xffffffff, PAGE_SIZE, 0);
@@ -926,11 +926,7 @@ pcn_tick(xsc)
sc = xsc;
ifp = sc->pcn_ifp;
- PCN_LOCK(sc);
- if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
- PCN_UNLOCK(sc);
- return;
- }
+ PCN_LOCK_ASSERT(sc);
mii = device_get_softc(sc->pcn_miibus);
mii_tick(mii);
@@ -949,8 +945,6 @@ pcn_tick(xsc)
callout_reset(&sc->pcn_stat_callout, hz, pcn_tick, sc);
- PCN_UNLOCK(sc);
-
return;
}
OpenPOWER on IntegriCloud