6c7b302
From 08b84d72878e43401e99059c3c926dfa42a360c3 Mon Sep 17 00:00:00 2001
6c7b302
From: Hans De Goede <hdegoede@redhat.com>
6c7b302
Date: Mon, 12 Dec 2016 17:03:13 +0100
6c7b302
Subject: [PATCH xserver 2/6] xfree86: Make OutputClassMatches take a
6c7b302
 xf86_platform_device
6c7b302
6c7b302
Make OutputClassMatches directly take a xf86_platform_device as argument,
6c7b302
rather then an index into xf86_platform_devices. This makes things
6c7b302
easier for callers which already have a xf86_platform_device pointer.
6c7b302
6c7b302
Reviewed-by: Adam Jackson <ajax@redhat.com>
6c7b302
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
6c7b302
---
6c7b302
 hw/xfree86/common/xf86platformBus.c | 7 ++++---
6c7b302
 1 file changed, 4 insertions(+), 3 deletions(-)
6c7b302
6c7b302
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
6c7b302
index 16d934f..25a9040 100644
6c7b302
--- a/hw/xfree86/common/xf86platformBus.c
6c7b302
+++ b/hw/xfree86/common/xf86platformBus.c
6c7b302
@@ -214,9 +214,10 @@ MatchToken(const char *value, struct xorg_list *patterns,
6c7b302
 }
6c7b302
 
6c7b302
 static Bool
6c7b302
-OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index)
6c7b302
+OutputClassMatches(const XF86ConfOutputClassPtr oclass,
6c7b302
+                   struct xf86_platform_device *dev)
6c7b302
 {
6c7b302
-    char *driver = xf86_platform_odev_attributes(index)->driver;
6c7b302
+    char *driver = dev->attribs->driver;
6c7b302
 
6c7b302
     if (!MatchToken(driver, &oclass->match_driver, strcmp))
6c7b302
         return FALSE;
6c7b302
@@ -234,7 +235,7 @@ xf86OutputClassDriverList(int index, char *matches[], int nmatches)
6c7b302
         return 0;
6c7b302
 
6c7b302
     for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) {
6c7b302
-        if (OutputClassMatches(cl, index)) {
6c7b302
+        if (OutputClassMatches(cl, &xf86_platform_devices[index])) {
6c7b302
             char *path = xf86_platform_odev_attributes(index)->path;
6c7b302
 
6c7b302
             xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n",
6c7b302
-- 
6c7b302
2.9.3
6c7b302