public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Birchinger <joker@netswarm.net>
To: inux-acpi <linux-acpi@vger.kernel.org>
Cc: Thomas Renninger <trenn@suse.de>, Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] Current brightness level got not set correctly in video module, fix it.
Date: Tue, 16 Oct 2007 19:48:40 +0200	[thread overview]
Message-ID: <20071016174840.GA17671@netswarm.net> (raw)
In-Reply-To: <1192549319.9847.623.camel@queen.suse.de>

On Tue, Oct 16, 2007 at 05:41:58PM +0200, Thomas Renninger wrote:
> Len, this should be a rather safe and obvious one. Can you apply it,
> pls.
> 
> Without this one, one should get NULL pointer when cap.BQC is not set as
> device->brightness should not be allocated then.
> 
> Christian: This should fix up the wrong initial 0 entry for the current
> brightness you saw.
> 
> Patch is against Len's git test tree and compile tested only.
> 
> Thanks,
> 
>    Thomas
> 
> ------------
> 
> Current brightness level got not set correctly in video module, fix it.
> 
> 
> Signed-off-by: Thomas Renninger <trenn@suse.de>
> ---
>  drivers/acpi/video.c |   14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> Index: lenb/drivers/acpi/video.c
> ===================================================================
> --- lenb.orig/drivers/acpi/video.c
> +++ lenb/drivers/acpi/video.c
> @@ -428,11 +428,15 @@ static int
>  acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
>  					unsigned long *level)
>  {
> -	if (device->cap._BQC)
> -		return acpi_evaluate_integer(device->dev->handle, "_BQC", NULL,
> -					     level);
> -	*level = device->brightness->curr;
> -	return AE_OK;
> +	acpi_status status = AE_OK;
> +
> +	if (device->cap._BQC){
> +		status = acpi_evaluate_integer(device->dev->handle, "_BQC",
> +					       NULL, level);
> +		if (ACPI_SUCCESS(status) && device->brightness)
> +			device->brightness->curr = *level;
> +	}
> +	return status;
>  }
>  
>  static int
> 

Looks fine here so far. Status is not 0 anymore on init and gets
updated when the brightness level changes.

I've put the function manualy into the 2.6.23.1 video.c because
the function was to different compared to the latest git.

Christian

      reply	other threads:[~2007-10-16 18:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16 15:41 [PATCH] Current brightness level got not set correctly in video module, fix it Thomas Renninger
2007-10-16 17:48 ` Christian Birchinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071016174840.GA17671@netswarm.net \
    --to=joker@netswarm.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=trenn@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox