From: Hans de Goede <hdegoede@redhat.com>
To: Mark Gross <markgross@kernel.org>, Andy Shevchenko <andy@kernel.org>
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 1/3] platform/x86: msi-laptop: Fix old-ec check for backlight registering
Date: Fri, 26 Aug 2022 13:17:38 +0200 [thread overview]
Message-ID: <a82bec5e-636e-5e2e-a2f4-e0867f8ec005@redhat.com> (raw)
In-Reply-To: <20220825141336.208597-1-hdegoede@redhat.com>
Hi,
On 8/25/22 16:13, Hans de Goede wrote:
> Commit 2cc6c717799f ("msi-laptop: Port to new backlight interface
> selection API") replaced this check:
>
> if (!quirks->old_ec_model || acpi_video_backlight_support())
> pr_info("Brightness ignored, ...");
> else
> do_register();
>
> With:
>
> if (quirks->old_ec_model ||
> acpi_video_get_backlight_type() == acpi_backlight_vendor)
> do_register();
>
> But since the do_register() part was part of the else branch, the entire
> condition should be inverted. So not only the 2 statements on either
> side of the || should be inverted, but the || itself should be replaced
> with a &&.
>
> In practice this has likely not been an issue because the new-ec models
> (old_ec_model==false) likely all support ACPI video backlight control,
> making acpi_video_get_backlight_type() return acpi_backlight_video
> turning the second part of the || also false when old_ec_model == false.
>
> Fixes: 2cc6c717799f ("msi-laptop: Port to new backlight interface selection API")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
I've added this series to my review-hans (soon to be for-next) branch now.
Regards,
Hans
> ---
> drivers/platform/x86/msi-laptop.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> index 93ef8851b93e..54170172a666 100644
> --- a/drivers/platform/x86/msi-laptop.c
> +++ b/drivers/platform/x86/msi-laptop.c
> @@ -1047,8 +1047,7 @@ static int __init msi_init(void)
> return -EINVAL;
>
> /* Register backlight stuff */
> -
> - if (quirks->old_ec_model ||
> + if (quirks->old_ec_model &&
> acpi_video_get_backlight_type() == acpi_backlight_vendor) {
> struct backlight_properties props;
> memset(&props, 0, sizeof(struct backlight_properties));
prev parent reply other threads:[~2022-08-26 11:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 14:13 [PATCH 1/3] platform/x86: msi-laptop: Fix old-ec check for backlight registering Hans de Goede
2022-08-25 14:13 ` [PATCH 2/3] platform/x86: msi-laptop: Simplify ec_delay handling Hans de Goede
2022-08-25 15:05 ` Andy Shevchenko
2022-08-25 15:30 ` Hans de Goede
2022-08-25 14:13 ` [PATCH 3/3] platform/x86: msi-laptop: Fix resource cleanup Hans de Goede
2022-08-25 15:05 ` Andy Shevchenko
2022-08-25 15:37 ` Hans de Goede
2022-08-25 15:04 ` [PATCH 1/3] platform/x86: msi-laptop: Fix old-ec check for backlight registering Andy Shevchenko
2022-08-26 11:17 ` Hans de Goede [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=a82bec5e-636e-5e2e-a2f4-e0867f8ec005@redhat.com \
--to=hdegoede@redhat.com \
--cc=andy@kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox