Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4500ca8e221e72cc38e7c239b9b1a041031ee450
Commit:     4500ca8e221e72cc38e7c239b9b1a041031ee450
Parent:     40ffbfad6bb79a99cc7627bdaca0ee22dec526f6
Author:     Alexey Starikovskiy <[EMAIL PROTECTED]>
AuthorDate: Mon Sep 3 16:29:58 2007 +0400
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Wed Sep 5 14:24:28 2007 -0400

    ACPI: video: Don't call absent methods
    
    Signed-off-by: Ryan May <[EMAIL PROTECTED]>
    Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/video.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 3c9bb85..83aa41c 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -409,14 +409,16 @@ acpi_video_device_lcd_query_levels(struct 
acpi_video_device *device,
 static int
 acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
 {
-       int status;
+       int status = AE_OK;
        union acpi_object arg0 = { ACPI_TYPE_INTEGER };
        struct acpi_object_list args = { 1, &arg0 };
 
 
        arg0.integer.value = level;
-       status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL);
-
+       if (device->cap._BCM)
+               status = acpi_evaluate_object(device->dev->handle, "_BCM",
+                                             &args, NULL);
+       device->brightness->curr = level;
        printk(KERN_DEBUG "set_level status: %x\n", status);
        return status;
 }
@@ -425,11 +427,11 @@ static int
 acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
                                        unsigned long *level)
 {
-       int status;
-
-       status = acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, 
level);
-
-       return status;
+       if (device->cap._BQC)
+               return acpi_evaluate_integer(device->dev->handle, "_BQC", NULL,
+                                            level);
+       *level = device->brightness->curr;
+       return AE_OK;
 }
 
 static int
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to