From: Helge Deller Date: Sun, 13 Jan 2008 23:01:13 +0000 (+0000) Subject: backlight: Avoid unecessary driver callbacks X-Git-Tag: v2.6.25-rc1~298^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=515524537999c1f107a0a7c7f74c034979c2c86d;p=linux-2.6-omap-h63xx.git backlight: Avoid unecessary driver callbacks Avoid driver callbacks when the brightness hasn't changed since they're not necessary. Signed-off-by: Helge Deller Signed-off-by: Richard Purdie --- diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 4840fe217e4..39394757679 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; } }