@@ -171,17 +171,17 @@ static ssize_t kovaplus_sysfs_write(struct file *fp, struct kobject *kobj,
171
171
172
172
#define KOVAPLUS_SYSFS_W (thingy , THINGY ) \
173
173
static ssize_t kovaplus_sysfs_write_ ## thingy(struct file *fp, \
174
- struct kobject *kobj, struct bin_attribute *attr, char *buf , \
175
- loff_t off, size_t count) \
174
+ struct kobject *kobj, const struct bin_attribute *attr, \
175
+ char *buf, loff_t off, size_t count) \
176
176
{ \
177
177
return kovaplus_sysfs_write(fp, kobj, buf, off, count, \
178
178
KOVAPLUS_SIZE_ ## THINGY, KOVAPLUS_COMMAND_ ## THINGY); \
179
179
}
180
180
181
181
#define KOVAPLUS_SYSFS_R (thingy , THINGY ) \
182
182
static ssize_t kovaplus_sysfs_read_ ## thingy(struct file *fp, \
183
- struct kobject *kobj, struct bin_attribute *attr, char *buf , \
184
- loff_t off, size_t count) \
183
+ struct kobject *kobj, const struct bin_attribute *attr, \
184
+ char *buf, loff_t off, size_t count) \
185
185
{ \
186
186
return kovaplus_sysfs_read(fp, kobj, buf, off, count, \
187
187
KOVAPLUS_SIZE_ ## THINGY, KOVAPLUS_COMMAND_ ## THINGY); \
@@ -193,28 +193,28 @@ KOVAPLUS_SYSFS_R(thingy, THINGY)
193
193
194
194
#define KOVAPLUS_BIN_ATTRIBUTE_RW (thingy , THINGY ) \
195
195
KOVAPLUS_SYSFS_RW(thingy, THINGY); \
196
- static struct bin_attribute bin_attr_##thingy = { \
196
+ static const struct bin_attribute bin_attr_##thingy = { \
197
197
.attr = { .name = #thingy, .mode = 0660 }, \
198
198
.size = KOVAPLUS_SIZE_ ## THINGY, \
199
- .read = kovaplus_sysfs_read_ ## thingy, \
200
- .write = kovaplus_sysfs_write_ ## thingy \
199
+ .read_new = kovaplus_sysfs_read_ ## thingy, \
200
+ .write_new = kovaplus_sysfs_write_ ## thingy \
201
201
}
202
202
203
203
#define KOVAPLUS_BIN_ATTRIBUTE_W (thingy , THINGY ) \
204
204
KOVAPLUS_SYSFS_W(thingy, THINGY); \
205
- static struct bin_attribute bin_attr_##thingy = { \
205
+ static const struct bin_attribute bin_attr_##thingy = { \
206
206
.attr = { .name = #thingy, .mode = 0220 }, \
207
207
.size = KOVAPLUS_SIZE_ ## THINGY, \
208
- .write = kovaplus_sysfs_write_ ## thingy \
208
+ .write_new = kovaplus_sysfs_write_ ## thingy \
209
209
}
210
210
KOVAPLUS_BIN_ATTRIBUTE_W (control , CONTROL );
211
211
KOVAPLUS_BIN_ATTRIBUTE_RW (info , INFO );
212
212
KOVAPLUS_BIN_ATTRIBUTE_RW (profile_settings , PROFILE_SETTINGS );
213
213
KOVAPLUS_BIN_ATTRIBUTE_RW (profile_buttons , PROFILE_BUTTONS );
214
214
215
215
static ssize_t kovaplus_sysfs_read_profilex_settings (struct file * fp ,
216
- struct kobject * kobj , struct bin_attribute * attr , char * buf ,
217
- loff_t off , size_t count )
216
+ struct kobject * kobj , const struct bin_attribute * attr ,
217
+ char * buf , loff_t off , size_t count )
218
218
{
219
219
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
220
220
struct usb_device * usb_dev = interface_to_usbdev (to_usb_interface (dev ));
@@ -231,8 +231,8 @@ static ssize_t kovaplus_sysfs_read_profilex_settings(struct file *fp,
231
231
}
232
232
233
233
static ssize_t kovaplus_sysfs_read_profilex_buttons (struct file * fp ,
234
- struct kobject * kobj , struct bin_attribute * attr , char * buf ,
235
- loff_t off , size_t count )
234
+ struct kobject * kobj , const struct bin_attribute * attr ,
235
+ char * buf , loff_t off , size_t count )
236
236
{
237
237
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
238
238
struct usb_device * usb_dev = interface_to_usbdev (to_usb_interface (dev ));
@@ -249,16 +249,16 @@ static ssize_t kovaplus_sysfs_read_profilex_buttons(struct file *fp,
249
249
}
250
250
251
251
#define PROFILE_ATTR (number ) \
252
- static struct bin_attribute bin_attr_profile##number##_settings = { \
252
+ static const struct bin_attribute bin_attr_profile##number##_settings = { \
253
253
.attr = { .name = "profile" #number "_settings", .mode = 0440 }, \
254
254
.size = KOVAPLUS_SIZE_PROFILE_SETTINGS, \
255
- .read = kovaplus_sysfs_read_profilex_settings, \
255
+ .read_new = kovaplus_sysfs_read_profilex_settings, \
256
256
.private = &profile_numbers[number-1], \
257
257
}; \
258
- static struct bin_attribute bin_attr_profile##number##_buttons = { \
258
+ static const struct bin_attribute bin_attr_profile##number##_buttons = { \
259
259
.attr = { .name = "profile" #number "_buttons", .mode = 0440 }, \
260
260
.size = KOVAPLUS_SIZE_PROFILE_BUTTONS, \
261
- .read = kovaplus_sysfs_read_profilex_buttons, \
261
+ .read_new = kovaplus_sysfs_read_profilex_buttons, \
262
262
.private = &profile_numbers[number-1], \
263
263
};
264
264
PROFILE_ATTR (1 );
@@ -379,7 +379,7 @@ static struct attribute *kovaplus_attrs[] = {
379
379
NULL ,
380
380
};
381
381
382
- static struct bin_attribute * kovaplus_bin_attributes [] = {
382
+ static const struct bin_attribute * const kovaplus_bin_attributes [] = {
383
383
& bin_attr_control ,
384
384
& bin_attr_info ,
385
385
& bin_attr_profile_settings ,
@@ -399,7 +399,7 @@ static struct bin_attribute *kovaplus_bin_attributes[] = {
399
399
400
400
static const struct attribute_group kovaplus_group = {
401
401
.attrs = kovaplus_attrs ,
402
- .bin_attrs = kovaplus_bin_attributes ,
402
+ .bin_attrs_new = kovaplus_bin_attributes ,
403
403
};
404
404
405
405
static const struct attribute_group * kovaplus_groups [] = {
0 commit comments