]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 19 May 2026 13:52:47 +0000 (16:52 +0300)
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>
drivers/platform/x86/uniwill/uniwill-acpi.c

index 1f9e9f61d387adc98ccee8df1d88d27b7b69b213..481c4cf46e6322fc192e81784c42d5af7d70a2e4 100644 (file)
@@ -2489,8 +2489,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 {
                /*
@@ -2508,6 +2506,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;