From: Henrique de Moraes Holschuh Subject: [PATCH] ACPI: ibm-acpi: fix initial status of backlight device Date: Thu, 8 Mar 2007 05:28:14 -0300 Message-ID: <11733424952501-git-send-email-hmh@hmh.eng.br> Return-path: Received: from out5.smtp.messagingengine.com ([66.111.4.29]:36374 "EHLO out5.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030259AbXCHI2U (ORCPT ); Thu, 8 Mar 2007 03:28:20 -0500 In-Reply-To: 20070308074326.GA13601@khazad-dum.debian.net References: 20070308074326.GA13601@khazad-dum.debian.net In-Reply-To: <20070308074326.GA13601@khazad-dum.debian.net> References: <20070308074326.GA13601@khazad-dum.debian.net> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, Henrique de Moraes Holschuh 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: Henrique de Moraes Holschuh Acked-by: Richard Purdie --- drivers/acpi/ibm_acpi.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 4cc534e..7c1b418 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c @@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = { 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_data); if (IS_ERR(ibm_backlight_device)) { @@ -1718,7 +1724,9 @@ static int brightness_init(void) 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; } -- 1.5.0.3