[Pommed-commits] [SCM] pommed - hotkeys handler for Apple laptops branch, master, updated. 1.38-4-g2082c1b

Julien BLACHE jb at jblache.org
Sat Apr 30 16:34:36 UTC 2011


The following commit has been merged in the master branch:
commit 923a1e600ca9ccb7fa886a19149b2115a1e138b3
Author: Julien BLACHE <jb at jblache.org>
Date:   Sat Apr 30 18:30:05 2011 +0200

    Rework mbp_sysfs_backlight_probe()

diff --git a/pommed/sysfs_backlight.c b/pommed/sysfs_backlight.c
index c608ccc..bd0a08f 100644
--- a/pommed/sysfs_backlight.c
+++ b/pommed/sysfs_backlight.c
@@ -47,6 +47,7 @@ enum {
   SYSFS_DRIVER_NOUVEAU,
   SYSFS_DRIVER_ACPI,
 #endif
+  SYSFS_DRIVER_MAX
 };
 
 
@@ -407,27 +408,15 @@ nvidia_sysfs_backlight_probe(void)
 int
 mbp_sysfs_backlight_probe(void)
 {
+  int drv;
   int ret;
 
-  ret = sysfs_backlight_probe(SYSFS_DRIVER_MBP);
-
-  if (ret == 0)
-    return 0;
-
-  ret = sysfs_backlight_probe(SYSFS_DRIVER_NVIDIA);
-
-  if (ret == 0)
-    return 0;
-
-  ret = sysfs_backlight_probe(SYSFS_DRIVER_NOUVEAU);
-
-  if (ret == 0)
-    return 0;
-
-  ret = sysfs_backlight_probe(SYSFS_DRIVER_ACPI);
-
-  if (ret == 0)
-    return 0;
+  for (drv = SYSFS_DRIVER_NONE + 1; drv < SYSFS_DRIVER_MAX; drv++)
+    {
+      ret = sysfs_backlight_probe(drv);
+      if (ret == 0)
+	return 0;
+    }
 
   /* Probe failed, wire up native driver instead */
   switch (mops->type)

-- 
pommed - hotkeys handler for Apple laptops



More information about the Pommed-commits mailing list