1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Release resources properly in detach.

This commit is contained in:
Doug Rabson 2000-06-10 17:53:20 +00:00
parent 111618cb42
commit 068b0778a3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61503
2 changed files with 18 additions and 0 deletions

View File

@ -246,6 +246,11 @@ static int
agp_amd_detach(device_t dev)
{
struct agp_amd_softc *sc = device_get_softc(dev);
int error;
error = agp_generic_detach(dev);
if (error)
return error;
/* Disable the TLB.. */
WRITE2(AGP_AMD751_STATUS,
@ -261,6 +266,10 @@ agp_amd_detach(device_t dev)
AGP_SET_APERTURE(dev, sc->initial_aperture);
agp_amd_free_gatt(sc->gatt);
bus_release_resource(dev, SYS_RES_MEMORY,
AGP_AMD751_REGISTERS, sc->regs);
return 0;
}

View File

@ -246,6 +246,11 @@ static int
agp_amd_detach(device_t dev)
{
struct agp_amd_softc *sc = device_get_softc(dev);
int error;
error = agp_generic_detach(dev);
if (error)
return error;
/* Disable the TLB.. */
WRITE2(AGP_AMD751_STATUS,
@ -261,6 +266,10 @@ agp_amd_detach(device_t dev)
AGP_SET_APERTURE(dev, sc->initial_aperture);
agp_amd_free_gatt(sc->gatt);
bus_release_resource(dev, SYS_RES_MEMORY,
AGP_AMD751_REGISTERS, sc->regs);
return 0;
}