Skip to content
Snippets Groups Projects
Commit 3e3265e7 authored by David Arcari's avatar David Arcari
Browse files

thermal: int3400: Remove unneeded data_vault attribute_group

JIRA: https://issues.redhat.com/browse/RHEL-79821



commit 13f3cbfbb8c9f3825a1e4e4371fe040fb35e41d5
Author: Thomas Weißschuh <linux@weissschuh.net>
Date:   Thu Nov 21 17:29:32 2024 +0100

    thermal: int3400: Remove unneeded data_vault attribute_group

    The group only contains a single entry and the conditionals around its
    lifecycle make clear that this won't change.

    Remove the unnecessary group.

    This saves some memory and it's easier to read.

    The removal of a non-const bin_attribute[] instance is also a
    preparation for the constification of struct bin_attributes.

Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
    Link: https://patch.msgid.link/20241121-sysfs-const-bin_attr-int340x_thermal-v1-1-2436facf9dae@weissschuh.net


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: default avatarDavid Arcari <darcari@redhat.com>
parent eee82da0
No related branches found
No related tags found
No related merge requests found
......@@ -82,11 +82,6 @@ static ssize_t data_vault_read(struct file *file, struct kobject *kobj,
static BIN_ATTR_RO(data_vault, 0);
static struct bin_attribute *data_attributes[] = {
&bin_attr_data_vault,
NULL,
};
static ssize_t imok_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
......@@ -115,10 +110,6 @@ static const struct attribute_group imok_attribute_group = {
.attrs = imok_attr,
};
static const struct attribute_group data_attribute_group = {
.bin_attrs = data_attributes,
};
static ssize_t available_uuids_show(struct device *dev,
struct device_attribute *attr,
char *buf)
......@@ -631,8 +622,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)
}
if (!ZERO_OR_NULL_PTR(priv->data_vault)) {
result = sysfs_create_group(&pdev->dev.kobj,
&data_attribute_group);
result = device_create_bin_file(&pdev->dev, &bin_attr_data_vault);
if (result)
goto free_uuid;
}
......@@ -655,7 +645,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)
free_sysfs:
cleanup_odvp(priv);
if (!ZERO_OR_NULL_PTR(priv->data_vault)) {
sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
device_remove_bin_file(&pdev->dev, &bin_attr_data_vault);
kfree(priv->data_vault);
}
free_uuid:
......@@ -690,7 +680,7 @@ static void int3400_thermal_remove(struct platform_device *pdev)
acpi_thermal_rel_misc_device_remove(priv->adev->handle);
if (!ZERO_OR_NULL_PTR(priv->data_vault))
sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
device_remove_bin_file(&pdev->dev, &bin_attr_data_vault);
sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
thermal_zone_device_unregister(priv->thermal);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment