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

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: dell-wmi-sysman: Use firmware_attributes_class helper

Update Dell WMI sysman driver to use newly implemented helper module.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Pearson <markpearson@lenovo.com>
Link: https://lore.kernel.org/r/20210530223111.25929-2-markpearson@lenovo.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Mark Pearson and committed by
Hans de Goede
8a1c379c 17b707fe

+9 -10
+1
drivers/platform/x86/dell/Kconfig
··· 206 206 depends on ACPI_WMI 207 207 depends on DMI 208 208 select NLS 209 + select FW_ATTR_CLASS 209 210 help 210 211 This driver allows changing BIOS settings on many Dell machines from 211 212 2018 and newer without the use of any additional software.
+8 -10
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/wmi.h> 15 15 #include "dell-wmi-sysman.h" 16 + #include "../../firmware_attributes_class.h" 16 17 17 18 #define MAX_TYPES 4 18 19 #include <linux/nls.h> 19 - 20 - static struct class firmware_attributes_class = { 21 - .name = "firmware-attributes", 22 - }; 23 20 24 21 struct wmi_sysman_priv wmi_priv = { 25 22 .mutex = __MUTEX_INITIALIZER(wmi_priv.mutex), ··· 25 28 /* reset bios to defaults */ 26 29 static const char * const reset_types[] = {"builtinsafe", "lastknowngood", "factory", "custom"}; 27 30 static int reset_option = -1; 31 + struct class *fw_attr_class; 28 32 29 33 30 34 /** ··· 540 542 goto err_exit_bios_attr_pass_interface; 541 543 } 542 544 543 - ret = class_register(&firmware_attributes_class); 545 + ret = fw_attributes_class_get(&fw_attr_class); 544 546 if (ret) 545 547 goto err_exit_bios_attr_pass_interface; 546 548 547 - wmi_priv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0), 549 + wmi_priv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0), 548 550 NULL, "%s", DRIVER_NAME); 549 551 if (IS_ERR(wmi_priv.class_dev)) { 550 552 ret = PTR_ERR(wmi_priv.class_dev); ··· 601 603 release_attributes_data(); 602 604 603 605 err_destroy_classdev: 604 - device_destroy(&firmware_attributes_class, MKDEV(0, 0)); 606 + device_destroy(fw_attr_class, MKDEV(0, 0)); 605 607 606 608 err_unregister_class: 607 - class_unregister(&firmware_attributes_class); 609 + fw_attributes_class_put(); 608 610 609 611 err_exit_bios_attr_pass_interface: 610 612 exit_bios_attr_pass_interface(); ··· 618 620 static void __exit sysman_exit(void) 619 621 { 620 622 release_attributes_data(); 621 - device_destroy(&firmware_attributes_class, MKDEV(0, 0)); 622 - class_unregister(&firmware_attributes_class); 623 + device_destroy(fw_attr_class, MKDEV(0, 0)); 624 + fw_attributes_class_put(); 623 625 exit_bios_attr_set_interface(); 624 626 exit_bios_attr_pass_interface(); 625 627 }