summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-arvo.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-24 15:05:11 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-19 21:22:34 -0700
commit46a58c44c173d3cbfa53931fbb7ad069ef59f190 (patch)
treeabccb167ff6c43c04215b7e670513d669afa10b9 /drivers/hid/hid-roccat-arvo.c
parenta93d6b0a879718a1a08553935744b0d5c58354c0 (diff)
downloadop-kernel-dev-46a58c44c173d3cbfa53931fbb7ad069ef59f190.zip
op-kernel-dev-46a58c44c173d3cbfa53931fbb7ad069ef59f190.tar.gz
HID: roccat: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the roccat class code to use the correct field. Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hid/hid-roccat-arvo.c')
-rw-r--r--drivers/hid/hid-roccat-arvo.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c
index 327f9b8..98bb89e 100644
--- a/drivers/hid/hid-roccat-arvo.c
+++ b/drivers/hid/hid-roccat-arvo.c
@@ -75,6 +75,8 @@ static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
return size;
}
+static DEVICE_ATTR(mode_key, 0660,
+ arvo_sysfs_show_mode_key, arvo_sysfs_set_mode_key);
static ssize_t arvo_sysfs_show_key_mask(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -123,6 +125,8 @@ static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
return size;
}
+static DEVICE_ATTR(key_mask, 0660,
+ arvo_sysfs_show_key_mask, arvo_sysfs_set_key_mask);
/* retval is 1-5 on success, < 0 on error */
static int arvo_get_actual_profile(struct usb_device *usb_dev)
@@ -179,6 +183,9 @@ static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,
mutex_unlock(&arvo->arvo_lock);
return retval;
}
+static DEVICE_ATTR(actual_profile, 0660,
+ arvo_sysfs_show_actual_profile,
+ arvo_sysfs_set_actual_profile);
static ssize_t arvo_sysfs_write(struct file *fp,
struct kobject *kobj, void const *buf,
@@ -239,17 +246,13 @@ static ssize_t arvo_sysfs_read_info(struct file *fp,
sizeof(struct arvo_info), ARVO_COMMAND_INFO);
}
-
-static struct device_attribute arvo_attributes[] = {
- __ATTR(mode_key, 0660,
- arvo_sysfs_show_mode_key, arvo_sysfs_set_mode_key),
- __ATTR(key_mask, 0660,
- arvo_sysfs_show_key_mask, arvo_sysfs_set_key_mask),
- __ATTR(actual_profile, 0660,
- arvo_sysfs_show_actual_profile,
- arvo_sysfs_set_actual_profile),
- __ATTR_NULL
+static struct attribute *arvo_attrs[] = {
+ &dev_attr_mode_key.attr,
+ &dev_attr_key_mask.attr,
+ &dev_attr_actual_profile.attr,
+ NULL,
};
+ATTRIBUTE_GROUPS(arvo);
static struct bin_attribute arvo_bin_attributes[] = {
{
@@ -430,7 +433,7 @@ static int __init arvo_init(void)
arvo_class = class_create(THIS_MODULE, "arvo");
if (IS_ERR(arvo_class))
return PTR_ERR(arvo_class);
- arvo_class->dev_attrs = arvo_attributes;
+ arvo_class->dev_groups = arvo_groups;
arvo_class->dev_bin_attrs = arvo_bin_attributes;
retval = hid_register_driver(&arvo_driver);
OpenPOWER on IntegriCloud