@@ -128,17 +128,17 @@ static ssize_t koneplus_sysfs_write(struct file *fp, struct kobject *kobj,
128
128
129
129
#define KONEPLUS_SYSFS_W (thingy , THINGY ) \
130
130
static ssize_t koneplus_sysfs_write_ ## thingy(struct file *fp, \
131
- struct kobject *kobj, struct bin_attribute *attr, char *buf , \
132
- loff_t off, size_t count) \
131
+ struct kobject *kobj, const struct bin_attribute *attr, \
132
+ char *buf, loff_t off, size_t count) \
133
133
{ \
134
134
return koneplus_sysfs_write(fp, kobj, buf, off, count, \
135
135
KONEPLUS_SIZE_ ## THINGY, KONEPLUS_COMMAND_ ## THINGY); \
136
136
}
137
137
138
138
#define KONEPLUS_SYSFS_R (thingy , THINGY ) \
139
139
static ssize_t koneplus_sysfs_read_ ## thingy(struct file *fp, \
140
- struct kobject *kobj, struct bin_attribute *attr, char *buf , \
141
- loff_t off, size_t count) \
140
+ struct kobject *kobj, const struct bin_attribute *attr, \
141
+ char *buf, loff_t off, size_t count) \
142
142
{ \
143
143
return koneplus_sysfs_read(fp, kobj, buf, off, count, \
144
144
KONEPLUS_SIZE_ ## THINGY, KONEPLUS_COMMAND_ ## THINGY); \
@@ -150,27 +150,27 @@ KONEPLUS_SYSFS_R(thingy, THINGY)
150
150
151
151
#define KONEPLUS_BIN_ATTRIBUTE_RW (thingy , THINGY ) \
152
152
KONEPLUS_SYSFS_RW(thingy, THINGY); \
153
- static struct bin_attribute bin_attr_##thingy = { \
153
+ static const struct bin_attribute bin_attr_##thingy = { \
154
154
.attr = { .name = #thingy, .mode = 0660 }, \
155
155
.size = KONEPLUS_SIZE_ ## THINGY, \
156
- .read = koneplus_sysfs_read_ ## thingy, \
157
- .write = koneplus_sysfs_write_ ## thingy \
156
+ .read_new = koneplus_sysfs_read_ ## thingy, \
157
+ .write_new = koneplus_sysfs_write_ ## thingy \
158
158
}
159
159
160
160
#define KONEPLUS_BIN_ATTRIBUTE_R (thingy , THINGY ) \
161
161
KONEPLUS_SYSFS_R(thingy, THINGY); \
162
- static struct bin_attribute bin_attr_##thingy = { \
162
+ static const struct bin_attribute bin_attr_##thingy = { \
163
163
.attr = { .name = #thingy, .mode = 0440 }, \
164
164
.size = KONEPLUS_SIZE_ ## THINGY, \
165
- .read = koneplus_sysfs_read_ ## thingy, \
165
+ .read_new = koneplus_sysfs_read_ ## thingy, \
166
166
}
167
167
168
168
#define KONEPLUS_BIN_ATTRIBUTE_W (thingy , THINGY ) \
169
169
KONEPLUS_SYSFS_W(thingy, THINGY); \
170
- static struct bin_attribute bin_attr_##thingy = { \
170
+ static const struct bin_attribute bin_attr_##thingy = { \
171
171
.attr = { .name = #thingy, .mode = 0220 }, \
172
172
.size = KONEPLUS_SIZE_ ## THINGY, \
173
- .write = koneplus_sysfs_write_ ## thingy \
173
+ .write_new = koneplus_sysfs_write_ ## thingy \
174
174
}
175
175
KONEPLUS_BIN_ATTRIBUTE_W (control , CONTROL );
176
176
KONEPLUS_BIN_ATTRIBUTE_W (talk , TALK );
@@ -183,8 +183,8 @@ KONEPLUS_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS);
183
183
KONEPLUS_BIN_ATTRIBUTE_RW (profile_buttons , PROFILE_BUTTONS );
184
184
185
185
static ssize_t koneplus_sysfs_read_profilex_settings (struct file * fp ,
186
- struct kobject * kobj , struct bin_attribute * attr , char * buf ,
187
- loff_t off , size_t count )
186
+ struct kobject * kobj , const struct bin_attribute * attr ,
187
+ char * buf , loff_t off , size_t count )
188
188
{
189
189
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
190
190
struct usb_device * usb_dev = interface_to_usbdev (to_usb_interface (dev ));
@@ -201,8 +201,8 @@ static ssize_t koneplus_sysfs_read_profilex_settings(struct file *fp,
201
201
}
202
202
203
203
static ssize_t koneplus_sysfs_read_profilex_buttons (struct file * fp ,
204
- struct kobject * kobj , struct bin_attribute * attr , char * buf ,
205
- loff_t off , size_t count )
204
+ struct kobject * kobj , const struct bin_attribute * attr ,
205
+ char * buf , loff_t off , size_t count )
206
206
{
207
207
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
208
208
struct usb_device * usb_dev = interface_to_usbdev (to_usb_interface (dev ));
@@ -219,16 +219,16 @@ static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp,
219
219
}
220
220
221
221
#define PROFILE_ATTR (number ) \
222
- static struct bin_attribute bin_attr_profile##number##_settings = { \
222
+ static const struct bin_attribute bin_attr_profile##number##_settings = { \
223
223
.attr = { .name = "profile" #number "_settings", .mode = 0440 }, \
224
224
.size = KONEPLUS_SIZE_PROFILE_SETTINGS, \
225
- .read = koneplus_sysfs_read_profilex_settings, \
225
+ .read_new = koneplus_sysfs_read_profilex_settings, \
226
226
.private = &profile_numbers[number-1], \
227
227
}; \
228
- static struct bin_attribute bin_attr_profile##number##_buttons = { \
228
+ static const struct bin_attribute bin_attr_profile##number##_buttons = { \
229
229
.attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \
230
230
.size = KONEPLUS_SIZE_PROFILE_BUTTONS, \
231
- .read = koneplus_sysfs_read_profilex_buttons, \
231
+ .read_new = koneplus_sysfs_read_profilex_buttons, \
232
232
.private = &profile_numbers[number-1], \
233
233
};
234
234
PROFILE_ATTR (1 );
@@ -321,7 +321,7 @@ static struct attribute *koneplus_attrs[] = {
321
321
NULL ,
322
322
};
323
323
324
- static struct bin_attribute * koneplus_bin_attributes [] = {
324
+ static const struct bin_attribute * const koneplus_bin_attributes [] = {
325
325
& bin_attr_control ,
326
326
& bin_attr_talk ,
327
327
& bin_attr_macro ,
@@ -346,7 +346,7 @@ static struct bin_attribute *koneplus_bin_attributes[] = {
346
346
347
347
static const struct attribute_group koneplus_group = {
348
348
.attrs = koneplus_attrs ,
349
- .bin_attrs = koneplus_bin_attributes ,
349
+ .bin_attrs_new = koneplus_bin_attributes ,
350
350
};
351
351
352
352
static const struct attribute_group * koneplus_groups [] = {
0 commit comments