Skip to content

Commit

Permalink
fujitsu-laptop: use FB_BLANK_* constants
Browse files Browse the repository at this point in the history
Replace the magic numbers in fujitsu-laptop.c by the appropriate FB_BLANK
constants, as indicated by the comment for backlight_properties.power in
include/linux/backlight.h.

Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
  • Loading branch information
Michael Karcher authored and Darren Hart committed Jan 23, 2015
1 parent 4690555 commit e8549e2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/platform/x86/fujitsu-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/input.h>
#include <linux/kfifo.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -398,7 +399,7 @@ static int bl_get_brightness(struct backlight_device *b)
static int bl_update_status(struct backlight_device *b)
{
int ret;
if (b->props.power == 4)
if (b->props.power == FB_BLANK_POWERDOWN)
ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x3);
else
ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x0);
Expand Down Expand Up @@ -1139,9 +1140,9 @@ static int __init fujitsu_init(void)

if (!acpi_video_backlight_support()) {
if (call_fext_func(FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
fujitsu->bl_device->props.power = 4;
fujitsu->bl_device->props.power = FB_BLANK_POWERDOWN;
else
fujitsu->bl_device->props.power = 0;
fujitsu->bl_device->props.power = FB_BLANK_UNBLANK;
}

pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
Expand Down

0 comments on commit e8549e2

Please sign in to comment.