All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Stephen Kitt <steve@sk2.org>
Cc: Lee Jones <lee@kernel.org>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>,
	linux-fbdev@vger.kernel.org, Helge Deller <deller@gmx.de>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH RESEND 2/4] backlight: arcxcnn: Use backlight helper
Date: Fri, 6 Jan 2023 18:44:49 +0100	[thread overview]
Message-ID: <Y7heER7NIHVFQY8a@ravnborg.org> (raw)
In-Reply-To: <20230106164856.1453819-3-steve@sk2.org>

On Fri, Jan 06, 2023 at 05:48:53PM +0100, Stephen Kitt wrote:
> Instead of retrieving the backlight brightness in struct
> backlight_properties manually, and then checking whether the backlight
> should be on at all, use backlight_get_brightness() which does all
> this and insulates this from future changes.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
>  drivers/video/backlight/arcxcnn_bl.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/video/backlight/arcxcnn_bl.c b/drivers/video/backlight/arcxcnn_bl.c
> index 555b036643fb..e610d7a1d13d 100644
> --- a/drivers/video/backlight/arcxcnn_bl.c
> +++ b/drivers/video/backlight/arcxcnn_bl.c
> @@ -130,12 +130,9 @@ static int arcxcnn_set_brightness(struct arcxcnn *lp, u32 brightness)
>  static int arcxcnn_bl_update_status(struct backlight_device *bl)
>  {
>  	struct arcxcnn *lp = bl_get_data(bl);
> -	u32 brightness = bl->props.brightness;
> +	u32 brightness = backlight_get_brightness(bl);
>  	int ret;
>  
> -	if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
> -		brightness = 0;
> -
>  	ret = arcxcnn_set_brightness(lp, brightness);
>  	if (ret)
>  		return ret;
> -- 
> 2.30.2

WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Stephen Kitt <steve@sk2.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	Lee Jones <lee@kernel.org>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 2/4] backlight: arcxcnn: Use backlight helper
Date: Fri, 6 Jan 2023 18:44:49 +0100	[thread overview]
Message-ID: <Y7heER7NIHVFQY8a@ravnborg.org> (raw)
In-Reply-To: <20230106164856.1453819-3-steve@sk2.org>

On Fri, Jan 06, 2023 at 05:48:53PM +0100, Stephen Kitt wrote:
> Instead of retrieving the backlight brightness in struct
> backlight_properties manually, and then checking whether the backlight
> should be on at all, use backlight_get_brightness() which does all
> this and insulates this from future changes.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
>  drivers/video/backlight/arcxcnn_bl.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/video/backlight/arcxcnn_bl.c b/drivers/video/backlight/arcxcnn_bl.c
> index 555b036643fb..e610d7a1d13d 100644
> --- a/drivers/video/backlight/arcxcnn_bl.c
> +++ b/drivers/video/backlight/arcxcnn_bl.c
> @@ -130,12 +130,9 @@ static int arcxcnn_set_brightness(struct arcxcnn *lp, u32 brightness)
>  static int arcxcnn_bl_update_status(struct backlight_device *bl)
>  {
>  	struct arcxcnn *lp = bl_get_data(bl);
> -	u32 brightness = bl->props.brightness;
> +	u32 brightness = backlight_get_brightness(bl);
>  	int ret;
>  
> -	if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
> -		brightness = 0;
> -
>  	ret = arcxcnn_set_brightness(lp, brightness);
>  	if (ret)
>  		return ret;
> -- 
> 2.30.2

  reply	other threads:[~2023-01-06 18:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 16:48 [PATCH RESEND 2/4] backlight: arcxcnn: Use backlight helper Stephen Kitt
2023-01-06 16:48 ` Stephen Kitt
2023-01-06 17:44 ` Sam Ravnborg [this message]
2023-01-06 17:44   ` Sam Ravnborg
2023-01-09 10:17 ` Daniel Thompson
2023-01-09 10:17   ` Daniel Thompson
2023-01-19 21:38 ` Lee Jones
2023-01-19 21:38   ` Lee Jones

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=Y7heER7NIHVFQY8a@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jingoohan1@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=steve@sk2.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.