diff options
author | jhb <jhb@FreeBSD.org> | 2012-10-15 15:59:13 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-10-15 15:59:13 +0000 |
commit | b6cd502114af104329133d7514158bccdfb90b05 (patch) | |
tree | c1d0d3b3d2226862567fd9564826ad386e062738 /sys/dev/aha/aha_mca.c | |
parent | f51b2a4393d1da10af18532f92a4ac5f9569578b (diff) | |
download | FreeBSD-src-b6cd502114af104329133d7514158bccdfb90b05.zip FreeBSD-src-b6cd502114af104329133d7514158bccdfb90b05.tar.gz |
Add locking to the aha(4) driver and mark it MPSAFE.
- Remove use of explicit bus space handles and tags.
Tested by: no one
Diffstat (limited to 'sys/dev/aha/aha_mca.c')
-rw-r--r-- | sys/dev/aha/aha_mca.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/aha/aha_mca.c b/sys/dev/aha/aha_mca.c index f09a7a4..0c50630 100644 --- a/sys/dev/aha/aha_mca.c +++ b/sys/dev/aha/aha_mca.c @@ -118,8 +118,6 @@ aha_mca_attach (device_t dev) { struct aha_softc * sc = device_get_softc(dev); int error = ENOMEM; - int unit = device_get_unit(dev); - void * ih; sc->portrid = 0; sc->port = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->portrid, @@ -145,8 +143,7 @@ aha_mca_attach (device_t dev) goto bad; } - aha_alloc(sc, unit, rman_get_bustag(sc->port), - rman_get_bushandle(sc->port)); + aha_alloc(sc); error = aha_probe(sc); if (error) { device_printf(dev, "aha_probe() failed!\n"); @@ -173,8 +170,8 @@ aha_mca_attach (device_t dev) /* nsegments */ ~0, /* maxsegsz */ BUS_SPACE_MAXSIZE_24BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &sc->parent_dmat); if (error) { device_printf(dev, "bus_dma_tag_create() failed!\n"); @@ -193,10 +190,11 @@ aha_mca_attach (device_t dev) goto bad; } - error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY, - NULL, aha_intr, sc, &ih); + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY | + INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); + aha_detach(sc); goto bad; } |