summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-08-28 09:43:16 +1000
committerAaron Plattner <aplattner@nvidia.com>2010-06-15 14:59:25 -0700
commit133f7c4d51b3c7d7e1e7af80056947d3a7ec2097 (patch)
tree04d62450558dd171e95a782b6c5f194e97602acc
parent6a86c607b68e016390553ec91cd2e39b65364a9a (diff)
nv: refuse to load if there's a kernel driver bound to the device already
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--src/nv_driver.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c
index 3063633..9fe70b2 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -865,6 +865,12 @@ NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data)
NVGetPCIXpressChip(dev) : dev->vendor_id << 16 | dev->device_id;
const char *name = xf86TokenToString(NVKnownChipsets, id);
+ if (pci_device_has_kernel_driver(dev)) {
+ ErrorF("The PCI device has a kernel module claiming it.\n");
+ ErrorF("This driver cannot operate until it has been unloaded\n");
+ return FALSE;
+ }
+
if(dev->vendor_id == PCI_VENDOR_NVIDIA && !name &&
!NVIsSupported(id) && !NVIsG80(id)) {
/* See if pci.ids knows what the heck this thing is */