aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86Bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Bus.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86Bus.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Bus.c b/xorg-server/hw/xfree86/common/xf86Bus.c
index b176e8cc4..b8764344b 100644
--- a/xorg-server/hw/xfree86/common/xf86Bus.c
+++ b/xorg-server/hw/xfree86/common/xf86Bus.c
@@ -420,6 +420,26 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev)
dev->claimed = TRUE;
}
+
+void
+xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev)
+{
+ EntityPtr pEnt;
+ int i, j;
+ if (entityIndex >= xf86NumEntities)
+ return;
+
+ pEnt = xf86Entities[entityIndex];
+ for (i = 0; i < pEnt->numInstances; i++) {
+ if (pEnt->devices[i] == dev) {
+ for (j = i; j < pEnt->numInstances - 1; j++)
+ pEnt->devices[j] = pEnt->devices[j + 1];
+ break;
+ }
+ }
+ pEnt->numInstances--;
+ dev->claimed = FALSE;
+}
/*
* xf86GetEntityInfo() -- This function hands information from the
* EntityRec struct to the drivers. The EntityRec structure itself