Patch "platform/x86: msi-laptop: Fix old-ec check for backlight registering" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/x86: msi-laptop: Fix old-ec check for backlight registering

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-x86-msi-laptop-fix-old-ec-check-for-backlig.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4f245d5e4f8933b5357890b4a62f5e30c23b7fcc
Author: Hans de Goede <hdegoede@xxxxxxxxxx>
Date:   Thu Aug 25 16:13:34 2022 +0200

    platform/x86: msi-laptop: Fix old-ec check for backlight registering
    
    [ Upstream commit 83ac7a1c2ed5f17caa07cbbc84bad3c05dc3bf22 ]
    
    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@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220825141336.208597-1-hdegoede@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index d5bfcc602090..7279390a2d54 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -1061,8 +1061,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));



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux