Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=515524537999c1f107a0a7c7f74c034979c2c86d
Commit:     515524537999c1f107a0a7c7f74c034979c2c86d
Parent:     488b5ec871191359b9b79262a3d48456dae7ea5f
Author:     Helge Deller <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 13 23:01:13 2008 +0000
Committer:  Richard Purdie <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 09:31:52 2008 +0000

    backlight: Avoid unecessary driver callbacks
    
    Avoid driver callbacks when the brightness hasn't changed since
    they're not necessary.
    
    Signed-off-by: Helge Deller <[EMAIL PROTECTED]>
    Signed-off-by: Richard Purdie <[EMAIL PROTECTED]>
---
 drivers/video/backlight/backlight.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/backlight.c 
b/drivers/video/backlight/backlight.c
index 4840fe2..3939475 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -94,8 +94,10 @@ static ssize_t backlight_store_power(struct device *dev,
        mutex_lock(&bd->ops_lock);
        if (bd->ops) {
                pr_debug("backlight: set power to %d\n", power);
-               bd->props.power = power;
-               backlight_update_status(bd);
+               if (bd->props.power != power) {
+                       bd->props.power = power;
+                       backlight_update_status(bd);
+               }
                rc = count;
        }
        mutex_unlock(&bd->ops_lock);
@@ -132,8 +134,10 @@ static ssize_t backlight_store_brightness(struct device 
*dev,
                else {
                        pr_debug("backlight: set brightness to %d\n",
                                 brightness);
-                       bd->props.brightness = brightness;
-                       backlight_update_status(bd);
+                       if (bd->props.brightness != brightness) {
+                               bd->props.brightness = brightness;
+                               backlight_update_status(bd);
+                       }
                        rc = count;
                }
        }
-
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