aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/an/if_an_isa.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2003-04-10 05:12:45 +0000
committerWarner Losh <imp@FreeBSD.org>2003-04-10 05:12:45 +0000
commit5414629575fdf477b31d66129dce5eba2234ff0f (patch)
tree8a49e3a329b214e661248279207e7a44442d5b7d /sys/dev/an/if_an_isa.c
parentf5746231ff7652f580d3f8f8ecec3f5fe47f1bdb (diff)
downloadsrc-5414629575fdf477b31d66129dce5eba2234ff0f.tar.gz
src-5414629575fdf477b31d66129dce5eba2234ff0f.zip
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
Notes
Notes: svn path=/head/; revision=113316
Diffstat (limited to 'sys/dev/an/if_an_isa.c')
-rw-r--r--sys/dev/an/if_an_isa.c17
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 3c23ac56f931..0dd709a2e474 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