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_ati.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_ati.c')
-rw-r--r-- | sys/dev/agp/agp_ati.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/agp/agp_ati.c b/sys/dev/agp/agp_ati.c index 0c3a1197616e..6bc60197aed8 100644 --- a/sys/dev/agp/agp_ati.c +++ b/sys/dev/agp/agp_ati.c @@ -248,18 +248,15 @@ static int agp_ati_detach(device_t dev) { struct agp_ati_softc *sc = device_get_softc(dev); - int error; u_int32_t apsize_reg, temp; + agp_free_cdev(dev); + if (sc->is_rs300) apsize_reg = ATI_RS300_APSIZE; else apsize_reg = ATI_RS100_APSIZE; - error = agp_generic_detach(dev); - if (error) - return error; - /* Clear the GATT base */ WRITE4(ATI_GART_BASE, 0); @@ -273,6 +270,7 @@ agp_ati_detach(device_t dev) free(sc->ag_virtual, M_AGP); bus_release_resource(dev, SYS_RES_MEMORY, ATI_GART_MMADDR, sc->regs); + agp_free_res(dev); return 0; } |