From 777508ca28f30e2c13f9507ffd7184fd78d81c22 Mon Sep 17 00:00:00 2001 From: mdodd Date: Sat, 8 Feb 2003 20:38:26 +0000 Subject: - Remove duplicate call to callout_handle_init() in pcn_attach(). - Conditionalize mtx_destroy() in pcn_attach(). - Assert driver lock in pcn_intr(). Submitted by: Hiten Pandya --- sys/pci/if_pcn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/pci') diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index 48d228e..8b539cd 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -657,7 +657,6 @@ pcn_attach(dev) * Call MI attach routine. */ ether_ifattach(ifp, (u_int8_t *) eaddr); - callout_handle_init(&sc->pcn_stat_ch); PCN_UNLOCK(sc); return(0); @@ -671,7 +670,8 @@ fail: if (sc->pcn_res) bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res); - mtx_destroy(&sc->pcn_mtx); + if (mtx_initialized(&sc->mtx) != 0) + mtx_destroy(&sc->pcn_mtx); return(error); } @@ -976,6 +976,8 @@ pcn_intr(arg) return; } + PCN_LOCK(sc); + CSR_WRITE_4(sc, PCN_IO32_RAP, PCN_CSR_CSR); while ((status = CSR_READ_4(sc, PCN_IO32_RDP)) & PCN_CSR_INTR) { @@ -996,6 +998,7 @@ pcn_intr(arg) if (ifp->if_snd.ifq_head != NULL) pcn_start(ifp); + PCN_UNLOCK(sc); return; } -- cgit v1.1