platform/x86: hp-bioscfg: Directly use firmware_attributes_class
[ Upstream commit 63f8c058036057644f095123a35895cd11639b88 ] 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-4-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: 11cba4793b95 ("platform/x86: hp-bioscfg: Fix class device unregistration") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
387da3b6d1
commit
8570c219cd
@@ -24,8 +24,6 @@ struct bioscfg_priv bioscfg_drv = {
|
|||||||
.mutex = __MUTEX_INITIALIZER(bioscfg_drv.mutex),
|
.mutex = __MUTEX_INITIALIZER(bioscfg_drv.mutex),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct class *fw_attr_class;
|
|
||||||
|
|
||||||
ssize_t display_name_language_code_show(struct kobject *kobj,
|
ssize_t display_name_language_code_show(struct kobject *kobj,
|
||||||
struct kobj_attribute *attr,
|
struct kobj_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
@@ -974,11 +972,7 @@ static int __init hp_init(void)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = fw_attributes_class_get(&fw_attr_class);
|
bioscfg_drv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0),
|
||||||
if (ret)
|
|
||||||
goto err_unregister_class;
|
|
||||||
|
|
||||||
bioscfg_drv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0),
|
|
||||||
NULL, "%s", DRIVER_NAME);
|
NULL, "%s", DRIVER_NAME);
|
||||||
if (IS_ERR(bioscfg_drv.class_dev)) {
|
if (IS_ERR(bioscfg_drv.class_dev)) {
|
||||||
ret = PTR_ERR(bioscfg_drv.class_dev);
|
ret = PTR_ERR(bioscfg_drv.class_dev);
|
||||||
@@ -1045,10 +1039,9 @@ err_release_attributes_data:
|
|||||||
release_attributes_data();
|
release_attributes_data();
|
||||||
|
|
||||||
err_destroy_classdev:
|
err_destroy_classdev:
|
||||||
device_destroy(fw_attr_class, MKDEV(0, 0));
|
device_destroy(&firmware_attributes_class, MKDEV(0, 0));
|
||||||
|
|
||||||
err_unregister_class:
|
err_unregister_class:
|
||||||
fw_attributes_class_put();
|
|
||||||
hp_exit_attr_set_interface();
|
hp_exit_attr_set_interface();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1057,9 +1050,8 @@ err_unregister_class:
|
|||||||
static void __exit hp_exit(void)
|
static void __exit hp_exit(void)
|
||||||
{
|
{
|
||||||
release_attributes_data();
|
release_attributes_data();
|
||||||
device_destroy(fw_attr_class, MKDEV(0, 0));
|
device_destroy(&firmware_attributes_class, MKDEV(0, 0));
|
||||||
|
|
||||||
fw_attributes_class_put();
|
|
||||||
hp_exit_attr_set_interface();
|
hp_exit_attr_set_interface();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user