Don't call bus_deactivate_resource() explicitly before calling

bus_release_resource().  This is needed for pc98 by upcoming nexus related
change.
This commit is contained in:
Yoshihiro Takahashi 2007-03-21 03:38:37 +00:00
parent 4eaa43e6f4
commit 41f5bd0f6d
14 changed files with 0 additions and 80 deletions

View File

@ -452,29 +452,21 @@ ar_deallocate_resources(device_t device)
struct ar_hardc *hc = device_get_softc(device);
if (hc->res_irq != 0) {
bus_deactivate_resource(device, SYS_RES_IRQ,
hc->rid_irq, hc->res_irq);
bus_release_resource(device, SYS_RES_IRQ,
hc->rid_irq, hc->res_irq);
hc->res_irq = 0;
}
if (hc->res_ioport != 0) {
bus_deactivate_resource(device, SYS_RES_IOPORT,
hc->rid_ioport, hc->res_ioport);
bus_release_resource(device, SYS_RES_IOPORT,
hc->rid_ioport, hc->res_ioport);
hc->res_ioport = 0;
}
if (hc->res_memory != 0) {
bus_deactivate_resource(device, SYS_RES_MEMORY,
hc->rid_memory, hc->res_memory);
bus_release_resource(device, SYS_RES_MEMORY,
hc->rid_memory, hc->res_memory);
hc->res_memory = 0;
}
if (hc->res_plx_memory != 0) {
bus_deactivate_resource(device, SYS_RES_MEMORY,
hc->rid_plx_memory, hc->res_plx_memory);
bus_release_resource(device, SYS_RES_MEMORY,
hc->rid_plx_memory, hc->res_plx_memory);
hc->res_plx_memory = 0;

View File

@ -889,7 +889,6 @@ static int ce_detach (device_t dev)
/* Disable the interrupt request. */
bus_teardown_intr (dev, bd->ce_irq, bd->ce_intrhand);
bus_deactivate_resource (dev, SYS_RES_IRQ, 0, bd->ce_irq);
bus_release_resource (dev, SYS_RES_IRQ, 0, bd->ce_irq);
TAU32_DestructiveHalt (b->ddk.pControllerObject, 0);
bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->ce_res);

View File

@ -139,22 +139,16 @@ cm_release_resources(dev)
struct cm_softc *sc = device_get_softc(dev);
if (sc->port_res != NULL) {
bus_deactivate_resource(dev, SYS_RES_IOPORT,
0, sc->port_res);
bus_release_resource(dev, SYS_RES_IOPORT,
0, sc->port_res);
sc->port_res = NULL;
}
if (sc->mem_res != NULL) {
bus_deactivate_resource(dev, SYS_RES_MEMORY,
0, sc->mem_res);
bus_release_resource(dev, SYS_RES_MEMORY,
0, sc->mem_res);
sc->mem_res = NULL;
}
if (sc->irq_res != NULL) {
bus_deactivate_resource(dev, SYS_RES_IRQ,
0, sc->irq_res);
bus_release_resource(dev, SYS_RES_IRQ,
0, sc->irq_res);
sc->irq_res = NULL;

View File

@ -650,7 +650,6 @@ static int cp_detach (device_t dev)
b->sys = NULL;
CP_UNLOCK (bd);
bus_deactivate_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq);
bus_release_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq);
bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res);

View File

@ -818,13 +818,10 @@ static int ct_detach (device_t dev)
CT_UNLOCK (bd);
bus_teardown_intr (dev, bd->irq_res, bd->intrhand);
bus_deactivate_resource (dev, SYS_RES_IRQ, bd->irq_rid, bd->irq_res);
bus_release_resource (dev, SYS_RES_IRQ, bd->irq_rid, bd->irq_res);
bus_deactivate_resource (dev, SYS_RES_DRQ, bd->drq_rid, bd->drq_res);
bus_release_resource (dev, SYS_RES_DRQ, bd->drq_rid, bd->drq_res);
bus_deactivate_resource (dev, SYS_RES_IOPORT, bd->base_rid, bd->irq_res);
bus_release_resource (dev, SYS_RES_IOPORT, bd->base_rid, bd->base_res);
CT_LOCK (bd);

View File

@ -957,13 +957,10 @@ static int cx_detach (device_t dev)
}
CX_UNLOCK (bd);
bus_teardown_intr (dev, bd->irq_res, bd->intrhand);
bus_deactivate_resource (dev, SYS_RES_IRQ, bd->irq_rid, bd->irq_res);
bus_release_resource (dev, SYS_RES_IRQ, bd->irq_rid, bd->irq_res);
bus_deactivate_resource (dev, SYS_RES_DRQ, bd->drq_rid, bd->drq_res);
bus_release_resource (dev, SYS_RES_DRQ, bd->drq_rid, bd->drq_res);
bus_deactivate_resource (dev, SYS_RES_IOPORT, bd->base_rid, bd->irq_res);
bus_release_resource (dev, SYS_RES_IOPORT, bd->base_rid, bd->base_res);
CX_LOCK (bd);

View File

@ -223,22 +223,16 @@ ed_release_resources(device_t dev)
struct ed_softc *sc = device_get_softc(dev);
if (sc->port_res) {
bus_deactivate_resource(dev, SYS_RES_IOPORT,
sc->port_rid, sc->port_res);
bus_release_resource(dev, SYS_RES_IOPORT,
sc->port_rid, sc->port_res);
sc->port_res = 0;
}
if (sc->mem_res) {
bus_deactivate_resource(dev, SYS_RES_MEMORY,
sc->mem_rid, sc->mem_res);
bus_release_resource(dev, SYS_RES_MEMORY,
sc->mem_rid, sc->mem_res);
sc->mem_res = 0;
}
if (sc->irq_res) {
bus_deactivate_resource(dev, SYS_RES_IRQ,
sc->irq_rid, sc->irq_res);
bus_release_resource(dev, SYS_RES_IRQ,
sc->irq_rid, sc->irq_res);
sc->irq_res = 0;

View File

@ -151,14 +151,10 @@ envctrl_attach(device_t dev)
error:
if (sc->res_irq != 0) {
bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
}
if (sc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
}
@ -181,11 +177,9 @@ envctrl_detach(device_t dev)
if (sc->res_irq != 0) {
bus_teardown_intr(dev, sc->res_irq, sc->intr_cookie);
bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq);
}
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport);
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport, sc->res_ioport);
return (0);

View File

@ -212,14 +212,10 @@ pcf_ebus_attach(device_t dev)
error:
if (sc->res_irq != 0) {
bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
}
if (sc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
}
@ -243,14 +239,10 @@ pcf_ebus_detach(device_t dev)
if (sc->res_irq != 0) {
bus_teardown_intr(dev, sc->res_irq,
sc->intr_cookie);
bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
}
bus_deactivate_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ioport,
sc->res_ioport);

View File

@ -172,14 +172,10 @@ pcf_isa_attach(device_t dev)
error:
if (sc->res_irq != 0) {
bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq,
sc->res_irq);
}
if (sc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
sc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport,
sc->res_ioport);
}
@ -202,11 +198,9 @@ pcf_isa_detach(device_t dev)
if (sc->res_irq != 0) {
bus_teardown_intr(dev, sc->res_irq, sc->intr_cookie);
bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq);
}
bus_deactivate_resource(dev, SYS_RES_IOPORT, sc->rid_ioport, sc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, sc->rid_ioport, sc->res_ioport);
return (0);

View File

@ -1779,14 +1779,10 @@ ppc_probe(device_t dev, int rid)
ppc->res_irq);
}
if (ppc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, ppc->rid_ioport,
ppc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, ppc->rid_ioport,
ppc->res_ioport);
}
if (ppc->res_drq != 0) {
bus_deactivate_resource(dev, SYS_RES_DRQ, ppc->rid_drq,
ppc->res_drq);
bus_release_resource(dev, SYS_RES_DRQ, ppc->rid_drq,
ppc->res_drq);
}
@ -1856,14 +1852,10 @@ ppc_detach(device_t dev)
ppc->res_irq);
}
if (ppc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, ppc->rid_ioport,
ppc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, ppc->rid_ioport,
ppc->res_ioport);
}
if (ppc->res_drq != 0) {
bus_deactivate_resource(dev, SYS_RES_DRQ, ppc->rid_drq,
ppc->res_drq);
bus_release_resource(dev, SYS_RES_DRQ, ppc->rid_drq,
ppc->res_drq);
}

View File

@ -568,29 +568,21 @@ sr_deallocate_resources(device_t device)
struct sr_hardc *hc = device_get_softc(device);
if (hc->res_irq != 0) {
bus_deactivate_resource(device, SYS_RES_IRQ,
hc->rid_irq, hc->res_irq);
bus_release_resource(device, SYS_RES_IRQ,
hc->rid_irq, hc->res_irq);
hc->res_irq = 0;
}
if (hc->res_ioport != 0) {
bus_deactivate_resource(device, SYS_RES_IOPORT,
hc->rid_ioport, hc->res_ioport);
bus_release_resource(device, SYS_RES_IOPORT,
hc->rid_ioport, hc->res_ioport);
hc->res_ioport = 0;
}
if (hc->res_memory != 0) {
bus_deactivate_resource(device, SYS_RES_MEMORY,
hc->rid_memory, hc->res_memory);
bus_release_resource(device, SYS_RES_MEMORY,
hc->rid_memory, hc->res_memory);
hc->res_memory = 0;
}
if (hc->res_plx_memory != 0) {
bus_deactivate_resource(device, SYS_RES_MEMORY,
hc->rid_plx_memory, hc->res_plx_memory);
bus_release_resource(device, SYS_RES_MEMORY,
hc->rid_plx_memory, hc->res_plx_memory);
hc->res_plx_memory = 0;

View File

@ -639,15 +639,11 @@ wl_deallocate_resources(device_t device)
struct wl_softc *sc = device_get_softc(device);
if (sc->res_irq != 0) {
bus_deactivate_resource(device, SYS_RES_IRQ,
sc->rid_irq, sc->res_irq);
bus_release_resource(device, SYS_RES_IRQ,
sc->rid_irq, sc->res_irq);
sc->res_irq = 0;
}
if (sc->res_ioport != 0) {
bus_deactivate_resource(device, SYS_RES_IOPORT,
sc->rid_ioport, sc->res_ioport);
bus_release_resource(device, SYS_RES_IOPORT,
sc->rid_ioport, sc->res_ioport);
sc->res_ioport = 0;

View File

@ -657,16 +657,12 @@ fdc_release_resources(struct fdc_data *fdc)
fdc->fdc_intr = NULL;
}
if (fdc->res_irq != 0) {
bus_deactivate_resource(dev, SYS_RES_IRQ, fdc->rid_irq,
fdc->res_irq);
bus_release_resource(dev, SYS_RES_IRQ, fdc->rid_irq,
fdc->res_irq);
fdc->res_irq = NULL;
}
#ifndef PC98
if (fdc->res_ctl != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, fdc->rid_ctl,
fdc->res_ctl);
bus_release_resource(dev, SYS_RES_IOPORT, fdc->rid_ctl,
fdc->res_ctl);
fdc->res_ctl = NULL;
@ -674,28 +670,20 @@ fdc_release_resources(struct fdc_data *fdc)
#endif
#ifdef PC98
if (fdc->res_fdsio != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, 3,
fdc->res_fdsio);
bus_release_resource(dev, SYS_RES_IOPORT, 3, fdc->res_fdsio);
fdc->res_fdsio = NULL;
}
if (fdc->res_fdemsio != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, 4,
fdc->res_fdemsio);
bus_release_resource(dev, SYS_RES_IOPORT, 4, fdc->res_fdemsio);
fdc->res_fdemsio = NULL;
}
#endif
if (fdc->res_ioport != 0) {
bus_deactivate_resource(dev, SYS_RES_IOPORT, fdc->rid_ioport,
fdc->res_ioport);
bus_release_resource(dev, SYS_RES_IOPORT, fdc->rid_ioport,
fdc->res_ioport);
fdc->res_ioport = NULL;
}
if (fdc->res_drq != 0) {
bus_deactivate_resource(dev, SYS_RES_DRQ, fdc->rid_drq,
fdc->res_drq);
bus_release_resource(dev, SYS_RES_DRQ, fdc->rid_drq,
fdc->res_drq);
fdc->res_drq = NULL;