diff options
author | John Baldwin <jhb@FreeBSD.org> | 2007-10-30 22:09:16 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2007-10-30 22:09:16 +0000 |
commit | f82a1d49879db9dcbfbf90328fc2e823a79a53a5 (patch) | |
tree | 4bbfaaad51fa35b2a857b9a295ba0233f3be30ff /sys/dev/agp/agp_amd64.c | |
parent | de8f7dcbaede5b279479ec9789b906bf85b20377 (diff) | |
download | src-f82a1d49879db9dcbfbf90328fc2e823a79a53a5.tar.gz src-f82a1d49879db9dcbfbf90328fc2e823a79a53a5.zip |
Split agp_generic_detach() up into two routines: agp_free_cdev() destroys
/dev/agpgart and agp_free_res() frees resources like the BAR for the
aperture. Splitting this up lets chipset-specific detach routines
manipulate the aperture during their detach routines without panicing.
MFC after: 1 week
Reviewed by: anholt
Notes
Notes:
svn path=/head/; revision=173203
Diffstat (limited to 'sys/dev/agp/agp_amd64.c')
-rw-r--r-- | sys/dev/agp/agp_amd64.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/agp/agp_amd64.c b/sys/dev/agp/agp_amd64.c index 9e5b6e26a28a..7c1a25d75886 100644 --- a/sys/dev/agp/agp_amd64.c +++ b/sys/dev/agp/agp_amd64.c @@ -250,10 +250,9 @@ static int agp_amd64_detach(device_t dev) { struct agp_amd64_softc *sc = device_get_softc(dev); - int i, error; + int i; - if ((error = agp_generic_detach(dev))) - return (error); + agp_free_cdev(dev); for (i = 0; i < sc->n_mctrl; i++) pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APCTRL, @@ -262,6 +261,7 @@ agp_amd64_detach(device_t dev) AGP_SET_APERTURE(dev, sc->initial_aperture); agp_free_gatt(sc->gatt); + agp_free_res(dev); return (0); } |