svn commit: r199230 - in head/sys/dev: dpms fb

Jung-uk Kim jkim at FreeBSD.org
Thu Nov 12 18:16:35 UTC 2009


Author: jkim
Date: Thu Nov 12 18:16:35 2009
New Revision: 199230
URL: http://svn.freebsd.org/changeset/base/199230

Log:
  - Remove a redundant check for dpms(4).
  - Test a cheaper function first.

Modified:
  head/sys/dev/dpms/dpms.c
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/dpms/dpms.c
==============================================================================
--- head/sys/dev/dpms/dpms.c	Thu Nov 12 17:56:56 2009	(r199229)
+++ head/sys/dev/dpms/dpms.c	Thu Nov 12 18:16:35 2009	(r199230)
@@ -125,12 +125,8 @@ static void
 dpms_identify(driver_t *driver, device_t parent)
 {
 
-	/* The DPMS VBE only allows for manipulating a single monitor. */
-	if (devclass_get_device(dpms_devclass, 0) != NULL)
-		return;
-
-	if (x86bios_match_device(0xc0000, parent) &&
-	    device_get_flags(parent) != 0)
+	if (device_get_flags(parent) != 0 &&
+	    x86bios_match_device(0xc0000, parent))
 		device_add_child(parent, "dpms", 0);
 }
 

Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c	Thu Nov 12 17:56:56 2009	(r199229)
+++ head/sys/dev/fb/vesa.c	Thu Nov 12 18:16:35 2009	(r199230)
@@ -250,8 +250,8 @@ vesa_bios_post(void)
 	dc = devclass_find("vgapci");
 	if (dc != NULL && devclass_get_devices(dc, &devs, &count) == 0) {
 		for (dev = NULL, i = 0; dev == NULL && i < count; devs++, i++)
-			if (x86bios_match_device(0xc0000, *devs) &&
-			    device_get_flags(*devs) != 0) {
+			if (device_get_flags(*devs) != 0 &&
+			    x86bios_match_device(0xc0000, *devs)) {
 				dev = *devs;
 				is_pci = 1;
 				break;


More information about the svn-src-all mailing list