From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Stuart Hayhurst <stuart.a.hayhurst@gmail.com>
Cc: platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Mark Gross <markgross@kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
Ike Panhc <ike.pan@canonical.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] platform/x86: ideapad-laptop: Set max_brightness before using it
Date: Tue, 14 Nov 2023 14:52:05 +0200 (EET) [thread overview]
Message-ID: <d37ef0cf-a8b-d445-c737-4b5ec78bc061@linux.intel.com> (raw)
In-Reply-To: <20231114114055.6220-2-stuart.a.hayhurst@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]
On Tue, 14 Nov 2023, Stuart Hayhurst wrote:
> max_brightness is used in ideapad_kbd_bl_brightness_get() before it's set,
> causing ideapad_kbd_bl_brightness_get() to return -EINVAL sometimes
>
> Fixes: ecaa1867b524 ("platform/x86: ideapad-laptop: Add support for keyboard backlights using KBLC ACPI symbol")
> Signed-off-by: Stuart Hayhurst <stuart.a.hayhurst@gmail.com>
> Cc: stable@vger.kernel.org
> ---
>
> Sorry if I messed up the stable cc bit, I have no idea how that process works
It looks fine now, thank you (except for the . missing at the end of the
sentence but I can fix that when I'll later apply the patch).
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
> v1 -> v2:
> - Fix commit message
> - Add missing tags
>
> ---
> drivers/platform/x86/ideapad-laptop.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index ac037540acfc..88eefccb6ed2 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1425,18 +1425,17 @@ static int ideapad_kbd_bl_init(struct ideapad_private *priv)
> if (WARN_ON(priv->kbd_bl.initialized))
> return -EEXIST;
>
> - brightness = ideapad_kbd_bl_brightness_get(priv);
> - if (brightness < 0)
> - return brightness;
> -
> - priv->kbd_bl.last_brightness = brightness;
> -
> if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) {
> priv->kbd_bl.led.max_brightness = 2;
> } else {
> priv->kbd_bl.led.max_brightness = 1;
> }
>
> + brightness = ideapad_kbd_bl_brightness_get(priv);
> + if (brightness < 0)
> + return brightness;
> +
> + priv->kbd_bl.last_brightness = brightness;
> priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT;
> priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get;
> priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set;
>
next prev parent reply other threads:[~2023-11-14 12:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-12 15:27 [PATCH] platform/x86: ideapad-laptop: Set max_brightness before using it Stuart Hayhurst
2023-11-14 11:02 ` Ilpo Järvinen
2023-11-14 11:38 ` [PATCH v2] " Stuart Hayhurst
2023-11-14 12:52 ` Ilpo Järvinen [this message]
2023-11-15 12:48 ` Ilpo Järvinen
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=d37ef0cf-a8b-d445-c737-4b5ec78bc061@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=ike.pan@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stuart.a.hayhurst@gmail.com \
/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