mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
sysfs: treewide: switch back to bin_attribute::read()/write()
The bin_attribute argument of bin_attribute::read() is now const. This makes the _new() callbacks unnecessary. Switch all users back. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20250530-sysfs-const-bin_attr-final-v3-3-724bfcf05b99@weissschuh.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
340d8e66c4
commit
2fbe82037a
@@ -208,7 +208,7 @@ static ssize_t read_opalcore(struct file *file, struct kobject *kobj,
|
||||
|
||||
static struct bin_attribute opal_core_attr __ro_after_init = {
|
||||
.attr = {.name = "core", .mode = 0400},
|
||||
.read_new = read_opalcore
|
||||
.read = read_opalcore
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -342,7 +342,7 @@ static void create_dump_obj(uint32_t id, size_t size, uint32_t type)
|
||||
dump->dump_attr.attr.name = "dump";
|
||||
dump->dump_attr.attr.mode = 0400;
|
||||
dump->dump_attr.size = size;
|
||||
dump->dump_attr.read_new = dump_attr_read;
|
||||
dump->dump_attr.read = dump_attr_read;
|
||||
|
||||
dump->id = id;
|
||||
dump->size = size;
|
||||
|
||||
@@ -203,7 +203,7 @@ static void create_elog_obj(uint64_t id, size_t size, uint64_t type)
|
||||
elog->raw_attr.attr.name = "raw";
|
||||
elog->raw_attr.attr.mode = 0400;
|
||||
elog->raw_attr.size = size;
|
||||
elog->raw_attr.read_new = raw_attr_read;
|
||||
elog->raw_attr.read = raw_attr_read;
|
||||
|
||||
elog->id = id;
|
||||
elog->size = size;
|
||||
|
||||
@@ -493,7 +493,7 @@ out:
|
||||
static const struct bin_attribute image_data_attr = {
|
||||
.attr = {.name = "image", .mode = 0200},
|
||||
.size = MAX_IMAGE_SIZE, /* Limit image size */
|
||||
.write_new = image_data_write,
|
||||
.write = image_data_write,
|
||||
};
|
||||
|
||||
static struct kobj_attribute validate_attribute =
|
||||
|
||||
@@ -102,7 +102,7 @@ static ssize_t opal_msglog_read(struct file *file, struct kobject *kobj,
|
||||
|
||||
static struct bin_attribute opal_msglog_attr __ro_after_init = {
|
||||
.attr = {.name = "msglog", .mode = 0400},
|
||||
.read_new = opal_msglog_read
|
||||
.read = opal_msglog_read
|
||||
};
|
||||
|
||||
struct memcons *__init memcons_init(struct device_node *node, const char *mc_prop_name)
|
||||
|
||||
@@ -815,7 +815,7 @@ static int opal_add_one_export(struct kobject *parent, const char *export_name,
|
||||
sysfs_bin_attr_init(attr);
|
||||
attr->attr.name = name;
|
||||
attr->attr.mode = 0400;
|
||||
attr->read_new = sysfs_bin_attr_simple_read;
|
||||
attr->read = sysfs_bin_attr_simple_read;
|
||||
attr->private = __va(vals[0]);
|
||||
attr->size = vals[1];
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ static ssize_t uv_msglog_read(struct file *file, struct kobject *kobj,
|
||||
|
||||
static struct bin_attribute uv_msglog_attr __ro_after_init = {
|
||||
.attr = {.name = "msglog", .mode = 0400},
|
||||
.read_new = uv_msglog_read
|
||||
.read = uv_msglog_read
|
||||
};
|
||||
|
||||
static int __init uv_init(void)
|
||||
|
||||
@@ -40,7 +40,7 @@ static const struct bin_attribute boot_params_data_attr = {
|
||||
.name = "data",
|
||||
.mode = S_IRUGO,
|
||||
},
|
||||
.read_new = boot_params_data_read,
|
||||
.read = boot_params_data_read,
|
||||
.size = sizeof(boot_params),
|
||||
};
|
||||
|
||||
@@ -250,7 +250,7 @@ static struct bin_attribute data_attr __ro_after_init = {
|
||||
.name = "data",
|
||||
.mode = S_IRUGO,
|
||||
},
|
||||
.read_new = setup_data_data_read,
|
||||
.read = setup_data_data_read,
|
||||
};
|
||||
|
||||
static struct attribute *setup_data_type_attrs[] = {
|
||||
|
||||
@@ -446,7 +446,7 @@ static DEVICE_ATTR_RO(parent_device);
|
||||
static const struct bin_attribute bin_attr_eeprom = {
|
||||
.attr = {.name = "eeprom", .mode = (0444)},
|
||||
.size = PAGE_SIZE,
|
||||
.read_new = eeprom_read_handler
|
||||
.read = eeprom_read_handler
|
||||
};
|
||||
|
||||
static struct attribute *hl_dev_attrs[] = {
|
||||
|
||||
@@ -372,7 +372,7 @@ static int acpi_table_attr_init(struct kobject *tables_obj,
|
||||
}
|
||||
|
||||
table_attr->attr.size = table_header->length;
|
||||
table_attr->attr.read_new = acpi_table_show;
|
||||
table_attr->attr.read = acpi_table_show;
|
||||
table_attr->attr.attr.name = table_attr->filename;
|
||||
table_attr->attr.attr.mode = 0400;
|
||||
|
||||
@@ -495,7 +495,7 @@ static int acpi_table_data_init(struct acpi_table_header *th)
|
||||
if (!data_attr)
|
||||
return -ENOMEM;
|
||||
sysfs_attr_init(&data_attr->attr.attr);
|
||||
data_attr->attr.read_new = acpi_data_show;
|
||||
data_attr->attr.read = acpi_data_show;
|
||||
data_attr->attr.attr.mode = 0400;
|
||||
return acpi_data_objs[i].fn(th, data_attr);
|
||||
}
|
||||
|
||||
@@ -359,8 +359,8 @@ out:
|
||||
static const struct bin_attribute firmware_attr_data = {
|
||||
.attr = { .name = "data", .mode = 0644 },
|
||||
.size = 0,
|
||||
.read_new = firmware_data_read,
|
||||
.write_new = firmware_data_write,
|
||||
.read = firmware_data_read,
|
||||
.write = firmware_data_write,
|
||||
};
|
||||
|
||||
static struct attribute *fw_dev_attrs[] = {
|
||||
|
||||
@@ -340,7 +340,7 @@ static int __init efi_mokvar_sysfs_init(void)
|
||||
mokvar_sysfs->bin_attr.attr.name = mokvar_entry->name;
|
||||
mokvar_sysfs->bin_attr.attr.mode = 0400;
|
||||
mokvar_sysfs->bin_attr.size = mokvar_entry->data_size;
|
||||
mokvar_sysfs->bin_attr.read_new = efi_mokvar_sysfs_read;
|
||||
mokvar_sysfs->bin_attr.read = efi_mokvar_sysfs_read;
|
||||
|
||||
err = sysfs_create_bin_file(mokvar_kobj,
|
||||
&mokvar_sysfs->bin_attr);
|
||||
|
||||
@@ -530,7 +530,7 @@ static ssize_t eventlog_write(struct file *filp, struct kobject *kobj,
|
||||
|
||||
static const struct bin_attribute eventlog_bin_attr = {
|
||||
.attr = {.name = "append_to_eventlog", .mode = 0200},
|
||||
.write_new = eventlog_write,
|
||||
.write = eventlog_write,
|
||||
};
|
||||
|
||||
static ssize_t gsmi_clear_eventlog_store(struct kobject *kobj,
|
||||
|
||||
@@ -28,7 +28,7 @@ static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
|
||||
|
||||
static struct bin_attribute memconsole_bin_attr = {
|
||||
.attr = {.name = "log", .mode = 0444},
|
||||
.read_new = memconsole_read,
|
||||
.read = memconsole_read,
|
||||
};
|
||||
|
||||
void memconsole_setup(ssize_t (*read_func)(char *, loff_t, size_t))
|
||||
|
||||
@@ -121,7 +121,7 @@ static int vpd_section_attrib_add(const u8 *key, u32 key_len,
|
||||
info->bin_attr.attr.name = info->key;
|
||||
info->bin_attr.attr.mode = 0444;
|
||||
info->bin_attr.size = value_len;
|
||||
info->bin_attr.read_new = vpd_attrib_read;
|
||||
info->bin_attr.read = vpd_attrib_read;
|
||||
info->bin_attr.private = info;
|
||||
|
||||
info->value = value;
|
||||
@@ -201,7 +201,7 @@ static int vpd_section_init(const char *name, struct vpd_section *sec,
|
||||
sec->bin_attr.attr.name = sec->raw_name;
|
||||
sec->bin_attr.attr.mode = 0444;
|
||||
sec->bin_attr.size = size;
|
||||
sec->bin_attr.read_new = vpd_section_read;
|
||||
sec->bin_attr.read = vpd_section_read;
|
||||
sec->bin_attr.private = sec;
|
||||
|
||||
err = sysfs_create_bin_file(vpd_kobj, &sec->bin_attr);
|
||||
|
||||
@@ -476,7 +476,7 @@ static ssize_t fw_cfg_sysfs_read_raw(struct file *filp, struct kobject *kobj,
|
||||
|
||||
static const struct bin_attribute fw_cfg_sysfs_attr_raw = {
|
||||
.attr = { .name = "raw", .mode = S_IRUSR },
|
||||
.read_new = fw_cfg_sysfs_read_raw,
|
||||
.read = fw_cfg_sysfs_read_raw,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -613,8 +613,8 @@ static const struct bin_attribute fsi_slave_raw_attr = {
|
||||
.mode = 0600,
|
||||
},
|
||||
.size = 0,
|
||||
.read_new = fsi_slave_sysfs_raw_read,
|
||||
.write_new = fsi_slave_sysfs_raw_write,
|
||||
.read = fsi_slave_sysfs_raw_read,
|
||||
.write = fsi_slave_sysfs_raw_write,
|
||||
};
|
||||
|
||||
static void fsi_slave_release(struct device *dev)
|
||||
|
||||
@@ -4117,8 +4117,8 @@ rel_buf:
|
||||
static const struct bin_attribute psp_vbflash_bin_attr = {
|
||||
.attr = {.name = "psp_vbflash", .mode = 0660},
|
||||
.size = 0,
|
||||
.write_new = amdgpu_psp_vbflash_write,
|
||||
.read_new = amdgpu_psp_vbflash_read,
|
||||
.write = amdgpu_psp_vbflash_write,
|
||||
.read = amdgpu_psp_vbflash_read,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -723,8 +723,8 @@ ret:
|
||||
static const struct bin_attribute data_attr = {
|
||||
.attr = {.name = "hdcp_srm", .mode = 0664},
|
||||
.size = PSP_HDCP_SRM_FIRST_GEN_MAX_SIZE, /* Limit SRM size */
|
||||
.write_new = srm_data_write,
|
||||
.read_new = srm_data_read,
|
||||
.write = srm_data_write,
|
||||
.read = srm_data_read,
|
||||
};
|
||||
|
||||
struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev,
|
||||
|
||||
@@ -319,7 +319,7 @@ static const struct bin_attribute edid_attr = {
|
||||
.attr.name = "edid",
|
||||
.attr.mode = 0444,
|
||||
.size = 0,
|
||||
.read_new = edid_show,
|
||||
.read = edid_show,
|
||||
};
|
||||
|
||||
static const struct bin_attribute *const connector_bin_attrs[] = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user