Skip to content

Commit 7dd457a

Browse files
committed
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'
2 parents b394eab + 7543d57 commit 7dd457a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

drivers/firmware/google/cbmem.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static struct cbmem_entry *to_cbmem_entry(struct kobject *kobj)
3030
}
3131

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

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

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

82-
static struct bin_attribute *bin_attrs[] = {
82+
static const struct bin_attribute *const bin_attrs[] = {
8383
&bin_attr_mem,
8484
NULL,
8585
};
8686

8787
static const struct attribute_group cbmem_entry_group = {
8888
.attrs = attrs,
89-
.bin_attrs = bin_attrs,
89+
.bin_attrs_new = bin_attrs,
9090
};
9191

9292
static const struct attribute_group *dev_groups[] = {

drivers/firmware/google/gsmi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static const struct efivar_operations efivar_ops = {
488488
#endif /* CONFIG_EFI */
489489

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

529529
}
530530

531-
static struct bin_attribute eventlog_bin_attr = {
531+
static const struct bin_attribute eventlog_bin_attr = {
532532
.attr = {.name = "append_to_eventlog", .mode = 0200},
533-
.write = eventlog_write,
533+
.write_new = eventlog_write,
534534
};
535535

536536
static ssize_t gsmi_clear_eventlog_store(struct kobject *kobj,

drivers/firmware/google/memconsole.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "memconsole.h"
1515

1616
static ssize_t memconsole_read(struct file *filp, struct kobject *kobp,
17-
struct bin_attribute *bin_attr, char *buf,
17+
const struct bin_attribute *bin_attr, char *buf,
1818
loff_t pos, size_t count)
1919
{
2020
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,
2828

2929
static struct bin_attribute memconsole_bin_attr = {
3030
.attr = {.name = "log", .mode = 0444},
31-
.read = memconsole_read,
31+
.read_new = memconsole_read,
3232
};
3333

3434
void memconsole_setup(ssize_t (*read_func)(char *, loff_t, size_t))

drivers/firmware/google/vpd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static struct vpd_section ro_vpd;
5656
static struct vpd_section rw_vpd;
5757

5858
static ssize_t vpd_attrib_read(struct file *filp, struct kobject *kobp,
59-
struct bin_attribute *bin_attr, char *buf,
59+
const struct bin_attribute *bin_attr, char *buf,
6060
loff_t pos, size_t count)
6161
{
6262
struct vpd_attrib_info *info = bin_attr->private;
@@ -121,7 +121,7 @@ static int vpd_section_attrib_add(const u8 *key, u32 key_len,
121121
info->bin_attr.attr.name = info->key;
122122
info->bin_attr.attr.mode = 0444;
123123
info->bin_attr.size = value_len;
124-
info->bin_attr.read = vpd_attrib_read;
124+
info->bin_attr.read_new = vpd_attrib_read;
125125
info->bin_attr.private = info;
126126

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

158158
static ssize_t vpd_section_read(struct file *filp, struct kobject *kobp,
159-
struct bin_attribute *bin_attr, char *buf,
159+
const struct bin_attribute *bin_attr, char *buf,
160160
loff_t pos, size_t count)
161161
{
162162
struct vpd_section *sec = bin_attr->private;
@@ -201,7 +201,7 @@ static int vpd_section_init(const char *name, struct vpd_section *sec,
201201
sec->bin_attr.attr.name = sec->raw_name;
202202
sec->bin_attr.attr.mode = 0444;
203203
sec->bin_attr.size = size;
204-
sec->bin_attr.read = vpd_section_read;
204+
sec->bin_attr.read_new = vpd_section_read;
205205
sec->bin_attr.private = sec;
206206

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

0 commit comments

Comments
 (0)