platform/x86: dell-sysman: Directly use firmware_attributes_class
authorThomas Weißschuh <linux@weissschuh.net>
Fri, 3 Jan 2025 23:05:13 +0000 (00:05 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 9 Jan 2025 11:40:26 +0000 (13:40 +0200)
The usage of the lifecycle functions is not necessary anymore.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20250104-firmware-attributes-simplify-v1-5-949f9709e405@weissschuh.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c

index 40ddc6eb75624e713dc4d2f7e92bc5f63fa4fde8..d00389b860e4ea0655c740c78bc3751f323b6370 100644 (file)
@@ -25,7 +25,6 @@ struct wmi_sysman_priv wmi_priv = {
 /* reset bios to defaults */
 static const char * const reset_types[] = {"builtinsafe", "lastknowngood", "factory", "custom"};
 static int reset_option = -1;
-static const struct class *fw_attr_class;
 
 
 /**
@@ -541,15 +540,11 @@ static int __init sysman_init(void)
                goto err_exit_bios_attr_pass_interface;
        }
 
-       ret = fw_attributes_class_get(&fw_attr_class);
-       if (ret)
-               goto err_exit_bios_attr_pass_interface;
-
-       wmi_priv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0),
+       wmi_priv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0),
                                  NULL, "%s", DRIVER_NAME);
        if (IS_ERR(wmi_priv.class_dev)) {
                ret = PTR_ERR(wmi_priv.class_dev);
-               goto err_unregister_class;
+               goto err_exit_bios_attr_pass_interface;
        }
 
        wmi_priv.main_dir_kset = kset_create_and_add("attributes", NULL,
@@ -602,10 +597,7 @@ err_release_attributes_data:
        release_attributes_data();
 
 err_destroy_classdev:
-       device_destroy(fw_attr_class, MKDEV(0, 0));
-
-err_unregister_class:
-       fw_attributes_class_put();
+       device_destroy(&firmware_attributes_class, MKDEV(0, 0));
 
 err_exit_bios_attr_pass_interface:
        exit_bios_attr_pass_interface();
@@ -619,8 +611,7 @@ err_exit_bios_attr_set_interface:
 static void __exit sysman_exit(void)
 {
        release_attributes_data();
-       device_destroy(fw_attr_class, MKDEV(0, 0));
-       fw_attributes_class_put();
+       device_destroy(&firmware_attributes_class, MKDEV(0, 0));
        exit_bios_attr_set_interface();
        exit_bios_attr_pass_interface();
 }