summaryrefslogtreecommitdiffstats
path: root/sys/dev/agp/agp_ali.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-10-30 22:09:16 +0000
committerjhb <jhb@FreeBSD.org>2007-10-30 22:09:16 +0000
commitfb7d38331162808946b7a5b8403973e269dec20d (patch)
tree4bbfaaad51fa35b2a857b9a295ba0233f3be30ff /sys/dev/agp/agp_ali.c
parent21b82a0c2984db5116c4ae71807cffe53301e89e (diff)
downloadFreeBSD-src-fb7d38331162808946b7a5b8403973e269dec20d.zip
FreeBSD-src-fb7d38331162808946b7a5b8403973e269dec20d.tar.gz
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
Diffstat (limited to 'sys/dev/agp/agp_ali.c')
-rw-r--r--sys/dev/agp/agp_ali.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/agp/agp_ali.c b/sys/dev/agp/agp_ali.c
index a619547..74bd2b1 100644
--- a/sys/dev/agp/agp_ali.c
+++ b/sys/dev/agp/agp_ali.c
@@ -141,12 +141,9 @@ static int
agp_ali_detach(device_t dev)
{
struct agp_ali_softc *sc = device_get_softc(dev);
- int error;
u_int32_t attbase;
- error = agp_generic_detach(dev);
- if (error)
- return error;
+ agp_free_cdev(dev);
/* Disable the TLB.. */
pci_write_config(dev, AGP_ALI_TLBCTRL, 0x90, 1);
@@ -157,6 +154,7 @@ agp_ali_detach(device_t dev)
pci_write_config(dev, AGP_ALI_ATTBASE, attbase & 0xfff, 4);
agp_free_gatt(sc->gatt);
+ agp_free_res(dev);
return 0;
}
OpenPOWER on IntegriCloud