diff options
Diffstat (limited to 'drivers/hid/hid-roccat-koneplus.c')
-rw-r--r-- | drivers/hid/hid-roccat-koneplus.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 6a48fa3c7da..11906b4b42b 100644 --- a/drivers/hid/hid-roccat-koneplus.c +++ b/drivers/hid/hid-roccat-koneplus.c @@ -274,6 +274,12 @@ static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev, return size; } +static DEVICE_ATTR(actual_profile, 0660, + koneplus_sysfs_show_actual_profile, + koneplus_sysfs_set_actual_profile); +static DEVICE_ATTR(startup_profile, 0660, + koneplus_sysfs_show_actual_profile, + koneplus_sysfs_set_actual_profile); static ssize_t koneplus_sysfs_show_firmware_version(struct device *dev, struct device_attribute *attr, char *buf) @@ -293,18 +299,16 @@ static ssize_t koneplus_sysfs_show_firmware_version(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version); } - -static struct device_attribute koneplus_attributes[] = { - __ATTR(actual_profile, 0660, - koneplus_sysfs_show_actual_profile, - koneplus_sysfs_set_actual_profile), - __ATTR(startup_profile, 0660, - koneplus_sysfs_show_actual_profile, - koneplus_sysfs_set_actual_profile), - __ATTR(firmware_version, 0440, - koneplus_sysfs_show_firmware_version, NULL), - __ATTR_NULL +static DEVICE_ATTR(firmware_version, 0440, + koneplus_sysfs_show_firmware_version, NULL); + +static struct attribute *koneplus_attrs[] = { + &dev_attr_actual_profile.attr, + &dev_attr_startup_profile.attr, + &dev_attr_firmware_version.attr, + NULL, }; +ATTRIBUTE_GROUPS(koneplus); static struct bin_attribute koneplus_bin_attributes[] = { KONEPLUS_BIN_ATTRIBUTE_W(control, CONTROL), @@ -572,7 +576,7 @@ static int __init koneplus_init(void) koneplus_class = class_create(THIS_MODULE, "koneplus"); if (IS_ERR(koneplus_class)) return PTR_ERR(koneplus_class); - koneplus_class->dev_attrs = koneplus_attributes; + koneplus_class->dev_groups = koneplus_groups; koneplus_class->dev_bin_attrs = koneplus_bin_attributes; retval = hid_register_driver(&koneplus_driver); |