diff options
author | imp <imp@FreeBSD.org> | 2003-04-10 05:12:45 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-04-10 05:12:45 +0000 |
commit | a7cc0ce91edc0b0b05e03eee868559ff872194d7 (patch) | |
tree | 8a49e3a329b214e661248279207e7a44442d5b7d /sys/dev/an/if_an_isa.c | |
parent | 0b41fd998b452c7ec8d7ba1da74ab2d3aeca7668 (diff) | |
download | FreeBSD-src-a7cc0ce91edc0b0b05e03eee868559ff872194d7.zip FreeBSD-src-a7cc0ce91edc0b0b05e03eee868559ff872194d7.tar.gz |
Don't lock in the attach routine. It isn't required. Register the
interrupt handler last. This gets rid of the sleep while locked
messages.
Reviewed by: ambrisko
Diffstat (limited to 'sys/dev/an/if_an_isa.c')
-rw-r--r-- | sys/dev/an/if_an_isa.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/an/if_an_isa.c b/sys/dev/an/if_an_isa.c index 3c23ac5..0dd709a 100644 --- a/sys/dev/an/if_an_isa.c +++ b/sys/dev/an/if_an_isa.c @@ -115,18 +115,23 @@ an_attach_isa(dev) an_alloc_port(dev, sc->port_rid, 1); an_alloc_irq(dev, sc->irq_rid, 0); + sc->an_bhandle = rman_get_bushandle(sc->port_res); + sc->an_btag = rman_get_bustag(sc->port_res); + sc->an_dev = dev; + + error = an_attach(sc, device_get_unit(dev), flags); + if (error) { + an_release_resources(dev); + return (error); + } + error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, an_intr, sc, &sc->irq_handle); if (error) { an_release_resources(dev); return (error); } - - sc->an_bhandle = rman_get_bushandle(sc->port_res); - sc->an_btag = rman_get_bustag(sc->port_res); - sc->an_dev = dev; - - return an_attach(sc, device_get_unit(dev), flags); + return (0); } static int |