platform/x86: dell-sysman: Directly use firmware_attributes_class
[ Upstream commit 501d2f0e78951b9a933bbff73404b25aec45f389 ] 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> Stable-dep-of: 314e5ad4782d ("platform/x86: dell-wmi-sysman: Fix class device unregistration") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4074f6a15e
commit
dba37f72aa
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user