]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86: msi-laptop: add missing sysfs_remove_group()
authorThomas Fourier <fourier.thomas@gmail.com>
Wed, 17 Dec 2025 10:36:13 +0000 (11:36 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 22 Dec 2025 14:17:49 +0000 (16:17 +0200)
A sysfs group is created in msi_init() when old_ec_model is enabled, but
never removed. Remove the msipf_old_attribute_group in that case.

Fixes: 03696e51d75a ("msi-laptop: Disable brightness control for new EC")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20251217103617.27668-2-fourier.thomas@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/msi-laptop.c

index c4b150fa093fefb39a28be3b122233637e8ab478..ddef6b78d2fa9f1ce0eaeaf3f5744cd7166a1609 100644 (file)
@@ -1130,6 +1130,9 @@ static void __exit msi_cleanup(void)
        sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
        if (!quirks->old_ec_model && threeg_exists)
                device_remove_file(&msipf_device->dev, &dev_attr_threeg);
+       if (quirks->old_ec_model)
+               sysfs_remove_group(&msipf_device->dev.kobj,
+                                  &msipf_old_attribute_group);
        platform_device_unregister(msipf_device);
        platform_driver_unregister(&msipf_driver);
        backlight_device_unregister(msibl_device);