summaryrefslogtreecommitdiffstats
path: root/sys/dev/aha/aha_isa.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-11-09 19:51:16 +0000
committerimp <imp@FreeBSD.org>2003-11-09 19:51:16 +0000
commite060a36d77eab7ddc10328b6d86ccbd6f044648f (patch)
tree0652da449588358cfb53cc4e077d8eb8e69e0d98 /sys/dev/aha/aha_isa.c
parent9189a12295dbbf9c9e8b80a6095bf5b7c3a24a8b (diff)
downloadFreeBSD-src-e060a36d77eab7ddc10328b6d86ccbd6f044648f.zip
FreeBSD-src-e060a36d77eab7ddc10328b6d86ccbd6f044648f.tar.gz
Let bus space manage softc.
Diffstat (limited to 'sys/dev/aha/aha_isa.c')
-rw-r--r--sys/dev/aha/aha_isa.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/sys/dev/aha/aha_isa.c b/sys/dev/aha/aha_isa.c
index b734724..f52b2ba 100644
--- a/sys/dev/aha/aha_isa.c
+++ b/sys/dev/aha/aha_isa.c
@@ -72,8 +72,7 @@ aha_isa_probe(device_t dev)
/*
* find unit and check we have that many defined
*/
- struct aha_softc **sc = device_get_softc(dev);
- struct aha_softc *aha;
+ struct aha_softc *aha = device_get_softc(dev);
int port_index;
int max_port_index;
int error;
@@ -83,8 +82,6 @@ aha_isa_probe(device_t dev)
int drq;
int irq;
- aha = NULL;
-
/* Check isapnp ids */
if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO)
return (ENXIO);
@@ -123,15 +120,9 @@ aha_isa_probe(device_t dev)
continue;
/* Allocate a softc for use during probing */
- aha = aha_alloc(device_get_unit(dev), rman_get_bustag(port_res),
+ aha_alloc(aha, device_get_unit(dev), rman_get_bustag(port_res),
rman_get_bushandle(port_res));
- if (aha == NULL) {
- bus_release_resource(dev, SYS_RES_IOPORT, port_rid,
- port_res);
- break;
- }
-
/* See if there is really a card present */
if (aha_probe(aha) || aha_fetch_adapter_info(aha)) {
aha_free(aha);
@@ -185,9 +176,6 @@ aha_isa_probe(device_t dev)
if (error)
return error;
- *sc = aha;
- aha_unit++;
-
return (0);
}
@@ -200,15 +188,13 @@ aha_isa_probe(device_t dev)
static int
aha_isa_attach(device_t dev)
{
- struct aha_softc **sc = device_get_softc(dev);
- struct aha_softc *aha;
+ struct aha_softc *aha = device_get_softc(dev);
bus_dma_filter_t *filter;
void *filter_arg;
bus_addr_t lowaddr;
void *ih;
int error;
- aha = *sc;
aha->portrid = 0;
aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid,
0, ~0, AHA_NREGS, RF_ACTIVE);
@@ -304,7 +290,7 @@ aha_isa_attach(device_t dev)
static int
aha_isa_detach(device_t dev)
{
- struct aha_softc *aha = *(struct aha_softc **) device_get_softc(dev);
+ struct aha_softc *aha = (struct aha_softc *)device_get_softc(dev);
int error;
error = bus_teardown_intr(dev, aha->irq, aha->ih);
@@ -344,7 +330,7 @@ static device_method_t aha_isa_methods[] = {
static driver_t aha_isa_driver = {
"aha",
aha_isa_methods,
- sizeof(struct aha_softc*),
+ sizeof(struct aha_softc),
};
static devclass_t aha_devclass;
OpenPOWER on IntegriCloud