@@ -261,7 +261,7 @@ static int kone_get_firmware_version(struct usb_device *usb_dev, int *result)
261
261
}
262
262
263
263
static ssize_t kone_sysfs_read_settings (struct file * fp , struct kobject * kobj ,
264
- struct bin_attribute * attr , char * buf ,
264
+ const struct bin_attribute * attr , char * buf ,
265
265
loff_t off , size_t count ) {
266
266
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
267
267
struct kone_device * kone = hid_get_drvdata (dev_get_drvdata (dev ));
@@ -285,7 +285,7 @@ static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj,
285
285
* case of error the old data is still valid
286
286
*/
287
287
static ssize_t kone_sysfs_write_settings (struct file * fp , struct kobject * kobj ,
288
- struct bin_attribute * attr , char * buf ,
288
+ const struct bin_attribute * attr , char * buf ,
289
289
loff_t off , size_t count ) {
290
290
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
291
291
struct kone_device * kone = hid_get_drvdata (dev_get_drvdata (dev ));
@@ -327,11 +327,11 @@ static ssize_t kone_sysfs_write_settings(struct file *fp, struct kobject *kobj,
327
327
328
328
return sizeof (struct kone_settings );
329
329
}
330
- static BIN_ATTR (settings , 0660 , kone_sysfs_read_settings ,
331
- kone_sysfs_write_settings , sizeof (struct kone_settings ));
330
+ static const BIN_ATTR (settings , 0660 , kone_sysfs_read_settings ,
331
+ kone_sysfs_write_settings , sizeof (struct kone_settings ));
332
332
333
333
static ssize_t kone_sysfs_read_profilex (struct file * fp ,
334
- struct kobject * kobj , struct bin_attribute * attr ,
334
+ struct kobject * kobj , const struct bin_attribute * attr ,
335
335
char * buf , loff_t off , size_t count ) {
336
336
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
337
337
struct kone_device * kone = hid_get_drvdata (dev_get_drvdata (dev ));
@@ -351,7 +351,7 @@ static ssize_t kone_sysfs_read_profilex(struct file *fp,
351
351
352
352
/* Writes data only if different to stored data */
353
353
static ssize_t kone_sysfs_write_profilex (struct file * fp ,
354
- struct kobject * kobj , struct bin_attribute * attr ,
354
+ struct kobject * kobj , const struct bin_attribute * attr ,
355
355
char * buf , loff_t off , size_t count ) {
356
356
struct device * dev = kobj_to_dev (kobj )-> parent -> parent ;
357
357
struct kone_device * kone = hid_get_drvdata (dev_get_drvdata (dev ));
@@ -382,11 +382,11 @@ static ssize_t kone_sysfs_write_profilex(struct file *fp,
382
382
return sizeof (struct kone_profile );
383
383
}
384
384
#define PROFILE_ATTR (number ) \
385
- static struct bin_attribute bin_attr_profile##number = { \
385
+ static const struct bin_attribute bin_attr_profile##number = { \
386
386
.attr = { .name = "profile" #number, .mode = 0660 }, \
387
387
.size = sizeof(struct kone_profile), \
388
- .read = kone_sysfs_read_profilex, \
389
- .write = kone_sysfs_write_profilex, \
388
+ .read_new = kone_sysfs_read_profilex, \
389
+ .write_new = kone_sysfs_write_profilex, \
390
390
.private = &profile_numbers[number-1], \
391
391
}
392
392
PROFILE_ATTR (1 );
@@ -634,7 +634,7 @@ static struct attribute *kone_attrs[] = {
634
634
NULL ,
635
635
};
636
636
637
- static struct bin_attribute * kone_bin_attributes [] = {
637
+ static const struct bin_attribute * const kone_bin_attributes [] = {
638
638
& bin_attr_settings ,
639
639
& bin_attr_profile1 ,
640
640
& bin_attr_profile2 ,
@@ -646,7 +646,7 @@ static struct bin_attribute *kone_bin_attributes[] = {
646
646
647
647
static const struct attribute_group kone_group = {
648
648
.attrs = kone_attrs ,
649
- .bin_attrs = kone_bin_attributes ,
649
+ .bin_attrs_new = kone_bin_attributes ,
650
650
};
651
651
652
652
static const struct attribute_group * kone_groups [] = {
0 commit comments