]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
platform/x86: uniwill-laptop: Fix behavior of "force" module param
authorArmin Wolf <W_Armin@gmx.de>
Tue, 12 May 2026 23:21:40 +0000 (01:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jun 2026 15:54:49 +0000 (17:54 +0200)
[ Upstream commit fb4b67c44557cb4cbb15900083d4e1af22320339 ]

Users might want to force-enable all possible features even on
machines with a valid device descriptor. Until now the "force"
module param was ignored on such machines. Fix this to make
it easier to test for support of new features.

Fixes: d050479693bb ("platform/x86: Add Uniwill laptop driver")
Reviewed-by: Werner Sembach <wse@tuxedocomputers.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260512232145.329260-4-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/uniwill/uniwill-acpi.c

index 07951e01b43db4c43c7c4ebd5cafa0a80af41cd8..540604c2977157c1431a8e937d28d525e3ad8739 100644 (file)
@@ -2189,8 +2189,6 @@ static int __init uniwill_init(void)
                if (!force)
                        return -ENODEV;
 
-               /* Assume that the device supports all features */
-               device_descriptor.features = UINT_MAX;
                pr_warn("Loading on a potentially unsupported device\n");
        } else {
                /*
@@ -2208,6 +2206,12 @@ static int __init uniwill_init(void)
                device_descriptor = *descriptor;
        }
 
+       if (force) {
+               /* Assume that the device supports all features */
+               device_descriptor.features = UINT_MAX;
+               pr_warn("Enabling potentially unsupported features\n");
+       }
+
        ret = platform_driver_register(&uniwill_driver);
        if (ret < 0)
                return ret;