Commit 7dd457a2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'chrome-platform-firmware-v6.14' of...

Merge tag 'chrome-platform-firmware-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform firmware updates from Tzung-Bi Shih:

 - Constify 'struct bin_attribute'.

* tag 'chrome-platform-firmware-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  firmware: google: vpd: Use const 'struct bin_attribute' callback
  firmware: google: memconsole: Use const 'struct bin_attribute' callback
  firmware: google: gsmi: Constify 'struct bin_attribute'
  firmware: google: cbmem: Constify 'struct bin_attribute'
parents b394eabd 7543d570
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ static struct cbmem_entry *to_cbmem_entry(struct kobject *kobj)
}

static ssize_t mem_read(struct file *filp, struct kobject *kobj,
			struct bin_attribute *bin_attr, char *buf, loff_t pos,
			const struct bin_attribute *bin_attr, char *buf, loff_t pos,
			size_t count)
{
	struct cbmem_entry *entry = to_cbmem_entry(kobj);
@@ -40,7 +40,7 @@ static ssize_t mem_read(struct file *filp, struct kobject *kobj,
}

static ssize_t mem_write(struct file *filp, struct kobject *kobj,
			 struct bin_attribute *bin_attr, char *buf, loff_t pos,
			 const struct bin_attribute *bin_attr, char *buf, loff_t pos,
			 size_t count)
{
	struct cbmem_entry *entry = to_cbmem_entry(kobj);
@@ -53,7 +53,7 @@ static ssize_t mem_write(struct file *filp, struct kobject *kobj,
	memcpy(entry->mem_file_buf + pos, buf, count);
	return count;
}
static BIN_ATTR_ADMIN_RW(mem, 0);
static const BIN_ATTR_ADMIN_RW(mem, 0);

static ssize_t address_show(struct device *dev, struct device_attribute *attr,
			    char *buf)
@@ -79,14 +79,14 @@ static struct attribute *attrs[] = {
	NULL,
};

static struct bin_attribute *bin_attrs[] = {
static const struct bin_attribute *const bin_attrs[] = {
	&bin_attr_mem,
	NULL,
};

static const struct attribute_group cbmem_entry_group = {
	.attrs = attrs,
	.bin_attrs = bin_attrs,
	.bin_attrs_new = bin_attrs,
};

static const struct attribute_group *dev_groups[] = {
+3 −3
Original line number Diff line number Diff line
@@ -488,7 +488,7 @@ static const struct efivar_operations efivar_ops = {
#endif /* CONFIG_EFI */

static ssize_t eventlog_write(struct file *filp, struct kobject *kobj,
			       struct bin_attribute *bin_attr,
			       const struct bin_attribute *bin_attr,
			       char *buf, loff_t pos, size_t count)
{
	struct gsmi_set_eventlog_param param = {
@@ -528,9 +528,9 @@ static ssize_t eventlog_write(struct file *filp, struct kobject *kobj,

}

static struct bin_attribute eventlog_bin_attr = {
static const struct bin_attribute eventlog_bin_attr = {
	.attr = {.name = "append_to_eventlog", .mode = 0200},
	.write = eventlog_write,
	.write_new = eventlog_write,
};

static ssize_t gsmi_clear_eventlog_store(struct kobject *kobj,
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#include "memconsole.h"

static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
			       struct bin_attribute *bin_attr, char *buf,
			       const struct bin_attribute *bin_attr, char *buf,
			       loff_t pos, size_t count)
{
	ssize_t (*memconsole_read_func)(char *, loff_t, size_t);
@@ -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 = memconsole_read,
	.read_new = memconsole_read,
};

void memconsole_setup(ssize_t (*read_func)(char *, loff_t, size_t))
+4 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static struct vpd_section ro_vpd;
static struct vpd_section rw_vpd;

static ssize_t vpd_attrib_read(struct file *filp, struct kobject *kobp,
			       struct bin_attribute *bin_attr, char *buf,
			       const struct bin_attribute *bin_attr, char *buf,
			       loff_t pos, size_t count)
{
	struct vpd_attrib_info *info = bin_attr->private;
@@ -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 = vpd_attrib_read;
	info->bin_attr.read_new = vpd_attrib_read;
	info->bin_attr.private = info;

	info->value = value;
@@ -156,7 +156,7 @@ static void vpd_section_attrib_destroy(struct vpd_section *sec)
}

static ssize_t vpd_section_read(struct file *filp, struct kobject *kobp,
				struct bin_attribute *bin_attr, char *buf,
				const struct bin_attribute *bin_attr, char *buf,
				loff_t pos, size_t count)
{
	struct vpd_section *sec = bin_attr->private;
@@ -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 = vpd_section_read;
	sec->bin_attr.read_new = vpd_section_read;
	sec->bin_attr.private = sec;

	err = sysfs_create_bin_file(vpd_kobj, &sec->bin_attr);