diff options
author | Helge Deller <deller@gmx.de> | 2008-01-14 00:01:13 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2008-02-07 10:31:52 +0100 |
commit | 515524537999c1f107a0a7c7f74c034979c2c86d (patch) | |
tree | 409cfcb5c15a2e46e67a9790850b94ac7a7fa8d4 /drivers/video | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/eri... (diff) | |
download | linux-515524537999c1f107a0a7c7f74c034979c2c86d.tar.xz linux-515524537999c1f107a0a7c7f74c034979c2c86d.zip |
backlight: Avoid unecessary driver callbacks
Avoid driver callbacks when the brightness hasn't changed since
they're not necessary.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | 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 4840fe217e4d..39394757679c 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; } } |