summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/apple_bl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/apple_bl.c')
-rw-r--r--drivers/video/backlight/apple_bl.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index e9e7acb577bf..aaa824437a2a 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -24,7 +24,7 @@
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/atomic.h>
-#include <linux/apple_bl.h>
+#include <acpi/video.h>
static struct backlight_device *apple_backlight_device;
@@ -215,32 +215,21 @@ static struct acpi_driver apple_bl_driver = {
},
};
-static atomic_t apple_bl_registered = ATOMIC_INIT(0);
-
-int apple_bl_register(void)
-{
- if (atomic_xchg(&apple_bl_registered, 1) == 0)
- return acpi_bus_register_driver(&apple_bl_driver);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(apple_bl_register);
-
-void apple_bl_unregister(void)
-{
- if (atomic_xchg(&apple_bl_registered, 0) == 1)
- acpi_bus_unregister_driver(&apple_bl_driver);
-}
-EXPORT_SYMBOL_GPL(apple_bl_unregister);
-
static int __init apple_bl_init(void)
{
- return apple_bl_register();
+ /*
+ * Use ACPI video detection code to see if this driver should register
+ * or if another driver, e.g. the apple-gmux driver should be used.
+ */
+ if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
+ return -ENODEV;
+
+ return acpi_bus_register_driver(&apple_bl_driver);
}
static void __exit apple_bl_exit(void)
{
- apple_bl_unregister();
+ acpi_bus_unregister_driver(&apple_bl_driver);
}
module_init(apple_bl_init);