Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86: dell-sysman: Directly use firmware_attributes_class

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>

authored by

Thomas Weißschuh and committed by
Ilpo Järvinen
501d2f0e 63f8c058

+4 -13
+4 -13
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
··· 25 25 /* reset bios to defaults */ 26 26 static const char * const reset_types[] = {"builtinsafe", "lastknowngood", "factory", "custom"}; 27 27 static int reset_option = -1; 28 - static const struct class *fw_attr_class; 29 28 30 29 31 30 /** ··· 540 541 goto err_exit_bios_attr_pass_interface; 541 542 } 542 543 543 - ret = fw_attributes_class_get(&fw_attr_class); 544 - if (ret) 545 - goto err_exit_bios_attr_pass_interface; 546 - 547 - wmi_priv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0), 544 + wmi_priv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0), 548 545 NULL, "%s", DRIVER_NAME); 549 546 if (IS_ERR(wmi_priv.class_dev)) { 550 547 ret = PTR_ERR(wmi_priv.class_dev); 551 - goto err_unregister_class; 548 + goto err_exit_bios_attr_pass_interface; 552 549 } 553 550 554 551 wmi_priv.main_dir_kset = kset_create_and_add("attributes", NULL, ··· 597 602 release_attributes_data(); 598 603 599 604 err_destroy_classdev: 600 - device_destroy(fw_attr_class, MKDEV(0, 0)); 601 - 602 - err_unregister_class: 603 - fw_attributes_class_put(); 605 + device_destroy(&firmware_attributes_class, MKDEV(0, 0)); 604 606 605 607 err_exit_bios_attr_pass_interface: 606 608 exit_bios_attr_pass_interface(); ··· 611 619 static void __exit sysman_exit(void) 612 620 { 613 621 release_attributes_data(); 614 - device_destroy(fw_attr_class, MKDEV(0, 0)); 615 - fw_attributes_class_put(); 622 + device_destroy(&firmware_attributes_class, MKDEV(0, 0)); 616 623 exit_bios_attr_set_interface(); 617 624 exit_bios_attr_pass_interface(); 618 625 }