[RFC][PATCH 4/6] xfree86: simplify xf86CallDriverProbe API and implementation

Tiago Vignatti tiago.vignatti at nokia.com
Tue Jul 14 10:06:41 PDT 2009


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
 hw/xfree86/common/xf86Init.c |   18 ++++++------------
 hw/xfree86/common/xf86Priv.h |    1 -
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index f8f7427..42f47fc 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -90,9 +90,6 @@
 #include "Pci.h"
 #include "xf86Bus.h"
 
-/* forward declarations */
-static Bool probe_devices_from_device_sections(DriverPtr drvp);
-
 #ifdef XF86PM
 void (*xf86OSPMClose)(void) = NULL;
 #endif
@@ -324,7 +321,7 @@ InstallSignalHandlers(void)
 #define END_OF_MATCHES(m) \
     (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0))
 
-Bool
+static Bool
 probe_devices_from_device_sections(DriverPtr drvp)
 {
     int i, j;
@@ -443,21 +440,18 @@ probe_devices_from_device_sections(DriverPtr drvp)
  * If a device can be successfully probed by the driver, \c TRUE is
  * returned.  Otherwise, \c FALSE is returned.
  */
-Bool
-xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
+static Bool
+xf86CallDriverProbe(DriverPtr drv)
 {
     Bool     foundScreen = FALSE;
 
-    if ( drv->PciProbe != NULL ) {
-	    assert( ! detect_only );
+    if ( drv->PciProbe != NULL )
 	    foundScreen = probe_devices_from_device_sections( drv );
-    }
 
     if ( ! foundScreen && (drv->Probe != NULL) ) {
 	xf86Msg( X_WARNING, "Falling back to old probe method for %s\n",
 		 drv->driverName );
-	foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT
-				     : PROBE_DEFAULT );
+	foundScreen = (*drv->Probe)(drv, PROBE_DEFAULT);
     }
 
     return foundScreen;
@@ -650,7 +644,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 		continue;
 	}
 
-	xf86CallDriverProbe( xf86DriverList[i], FALSE );
+	xf86CallDriverProbe( xf86DriverList[i]);
     }
 
     /*
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index b80af3f..633a1d4 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -155,7 +155,6 @@ extern _X_EXPORT void xf86CloseLog(void);
 extern _X_EXPORT Bool xf86LoadModules(char **list, pointer *optlist);
 extern _X_EXPORT int xf86SetVerbosity(int verb);
 extern _X_EXPORT int xf86SetLogVerbosity(int verb);
-extern _X_EXPORT Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only );
 
 /* xf86Xinput.c */
 extern _X_EXPORT EventList *xf86Events;
-- 
1.5.6.3



More information about the xorg-devel mailing list