ACPI: ibm-acpi: fix initial status of backlight device

The brightness class core does not update the initial status of the
device's brightness at register time.  Do it by ourselves.
Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: default avatarRichard Purdie <rpurdie@rpsys.net>
parent c8f71b01
...@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = { ...@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = {
static int brightness_init(void) static int brightness_init(void)
{ {
int b;
b = brightness_get(NULL);
if (b < 0)
return b;
ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
&ibm_backlight_data); &ibm_backlight_data);
if (IS_ERR(ibm_backlight_device)) { if (IS_ERR(ibm_backlight_device)) {
...@@ -1718,7 +1724,9 @@ static int brightness_init(void) ...@@ -1718,7 +1724,9 @@ static int brightness_init(void)
return PTR_ERR(ibm_backlight_device); return PTR_ERR(ibm_backlight_device);
} }
ibm_backlight_device->props.max_brightness = 7; ibm_backlight_device->props.max_brightness = 7;
ibm_backlight_device->props.brightness = b;
backlight_update_status(ibm_backlight_device);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment