summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/opregion.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-05-10 10:33:02 +0300
committerDave Airlie <airlied@redhat.com>2012-05-17 11:15:23 +0100
commitfcf92202e7bc2e8513ae045e3ec61e79c1c9e690 (patch)
treed518feb028130214aafc406c47b93f8791a85f0b /drivers/gpu/drm/gma500/opregion.c
parentce0679136678a58cbeca40acd84b6a0462637454 (diff)
gma500: silence an unused variable warning
If CONFIG_BACKLIGHT_CLASS_DEVICE is disabled then GCC warns that: drivers/gpu/drm/gma500/opregion.c:154:6: warning: unused variable ‘max’ [-Wunused-variable] Which give me a chance to use the new config_enabled() macro. :) Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/gma500/opregion.c')
-rw-r--r--drivers/gpu/drm/gma500/opregion.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.c
index aa9e89f7e4c..4f186eca3a3 100644
--- a/drivers/gpu/drm/gma500/opregion.c
+++ b/drivers/gpu/drm/gma500/opregion.c
@@ -149,7 +149,6 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
struct drm_psb_private *dev_priv = dev->dev_private;
struct opregion_asle *asle = dev_priv->opregion.asle;
struct backlight_device *bd = dev_priv->backlight_device;
- u32 max;
DRM_DEBUG_DRIVER("asle set backlight %x\n", bclp);
@@ -163,11 +162,12 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
if (bclp > 255)
return ASLE_BACKLIGHT_FAILED;
-#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
- max = bd->props.max_brightness;
- bd->props.brightness = bclp * max / 255;
- backlight_update_status(bd);
-#endif
+ if (config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)) {
+ int max = bd->props.max_brightness;
+ bd->props.brightness = bclp * max / 255;
+ backlight_update_status(bd);
+ }
+
asle->cblv = (bclp * 0x64) / 0xff | ASLE_CBLV_VALID;
return 0;