Make OutputClassMatches directly take a xf86_platform_device as argument, rather then an index into xf86_platform_devices. This makes things easier for callers which already have a xf86_platform_device pointer.
Signed-off-by: Hans de Goede <hdego...@redhat.com> --- hw/xfree86/common/xf86platformBus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index c8378a5..d1c2d1a 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -215,9 +215,10 @@ MatchToken(const char *value, struct xorg_list *patterns, } static Bool -OutputClassMatches(const XF86ConfOutputClassPtr oclass, int index) +OutputClassMatches(const XF86ConfOutputClassPtr oclass, + struct xf86_platform_device *dev) { - char *driver = xf86_platform_odev_attributes(index)->driver; + char *driver = dev->attribs->driver; if (!MatchToken(driver, &oclass->match_driver, strcmp)) return FALSE; @@ -235,7 +236,7 @@ xf86OutputClassDriverList(int index, char *matches[], int nmatches) return 0; for (cl = xf86configptr->conf_outputclass_lst; cl; cl = cl->list.next) { - if (OutputClassMatches(cl, index)) { + if (OutputClassMatches(cl, &xf86_platform_devices[index])) { char *path = xf86_platform_odev_attributes(index)->path; xf86Msg(X_INFO, "Applying OutputClass \"%s\" to %s\n", -- 2.9.3 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel