Commit 39ea150b authored by Dave Jones's avatar Dave Jones

don't allow backend to unload if in use by a chipset driver.

parent 655c8747
...@@ -261,7 +261,7 @@ int agp_register_driver (struct pci_dev *dev) ...@@ -261,7 +261,7 @@ int agp_register_driver (struct pci_dev *dev)
return 0; return 0;
} }
int __exit agp_unregister_driver(void) int agp_unregister_driver(void)
{ {
agp_bridge.type = NOT_SUPPORTED; agp_bridge.type = NOT_SUPPORTED;
pm_unregister_all(agp_power); pm_unregister_all(agp_power);
...@@ -272,6 +272,14 @@ int __exit agp_unregister_driver(void) ...@@ -272,6 +272,14 @@ int __exit agp_unregister_driver(void)
return 0; return 0;
} }
int __exit agp_exit(void)
{
if (agp_count==0)
return -EBUSY;
return 0;
}
int __init agp_init(void) int __init agp_init(void)
{ {
static int already_initialised=0; static int already_initialised=0;
...@@ -291,6 +299,7 @@ int __init agp_init(void) ...@@ -291,6 +299,7 @@ int __init agp_init(void)
#ifndef CONFIG_GART_IOMMU #ifndef CONFIG_GART_IOMMU
module_init(agp_init); module_init(agp_init);
module_exit(agp_exit);
#endif #endif
EXPORT_SYMBOL(agp_backend_acquire); EXPORT_SYMBOL(agp_backend_acquire);
......
...@@ -1079,7 +1079,7 @@ int __init agp_frontend_initialize(void) ...@@ -1079,7 +1079,7 @@ int __init agp_frontend_initialize(void)
return 0; return 0;
} }
void __exit agp_frontend_cleanup(void) void agp_frontend_cleanup(void)
{ {
misc_deregister(&agp_miscdev); misc_deregister(&agp_miscdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment