diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-20 00:22:34 -0400 |
commit | 46a58c44c173d3cbfa53931fbb7ad069ef59f190 (patch) | |
tree | abccb167ff6c43c04215b7e670513d669afa10b9 /drivers/hid/hid-roccat-arvo.c | |
parent | a93d6b0a879718a1a08553935744b0d5c58354c0 (diff) |
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.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c index 327f9b8ed1f4..98bb89e0d91b 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, | |||
75 | 75 | ||
76 | return size; | 76 | return size; |
77 | } | 77 | } |
78 | static DEVICE_ATTR(mode_key, 0660, | ||
79 | arvo_sysfs_show_mode_key, arvo_sysfs_set_mode_key); | ||
78 | 80 | ||
79 | static ssize_t arvo_sysfs_show_key_mask(struct device *dev, | 81 | static ssize_t arvo_sysfs_show_key_mask(struct device *dev, |
80 | struct device_attribute *attr, char *buf) | 82 | struct device_attribute *attr, char *buf) |
@@ -123,6 +125,8 @@ static ssize_t arvo_sysfs_set_key_mask(struct device *dev, | |||
123 | 125 | ||
124 | return size; | 126 | return size; |
125 | } | 127 | } |
128 | static DEVICE_ATTR(key_mask, 0660, | ||
129 | arvo_sysfs_show_key_mask, arvo_sysfs_set_key_mask); | ||
126 | 130 | ||
127 | /* retval is 1-5 on success, < 0 on error */ | 131 | /* retval is 1-5 on success, < 0 on error */ |
128 | static int arvo_get_actual_profile(struct usb_device *usb_dev) | 132 | 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, | |||
179 | mutex_unlock(&arvo->arvo_lock); | 183 | mutex_unlock(&arvo->arvo_lock); |
180 | return retval; | 184 | return retval; |
181 | } | 185 | } |
186 | static DEVICE_ATTR(actual_profile, 0660, | ||
187 | arvo_sysfs_show_actual_profile, | ||
188 | arvo_sysfs_set_actual_profile); | ||
182 | 189 | ||
183 | static ssize_t arvo_sysfs_write(struct file *fp, | 190 | static ssize_t arvo_sysfs_write(struct file *fp, |
184 | struct kobject *kobj, void const *buf, | 191 | struct kobject *kobj, void const *buf, |
@@ -239,17 +246,13 @@ static ssize_t arvo_sysfs_read_info(struct file *fp, | |||
239 | sizeof(struct arvo_info), ARVO_COMMAND_INFO); | 246 | sizeof(struct arvo_info), ARVO_COMMAND_INFO); |
240 | } | 247 | } |
241 | 248 | ||
242 | 249 | static struct attribute *arvo_attrs[] = { | |
243 | static struct device_attribute arvo_attributes[] = { | 250 | &dev_attr_mode_key.attr, |
244 | __ATTR(mode_key, 0660, | 251 | &dev_attr_key_mask.attr, |
245 | arvo_sysfs_show_mode_key, arvo_sysfs_set_mode_key), | 252 | &dev_attr_actual_profile.attr, |
246 | __ATTR(key_mask, 0660, | 253 | NULL, |
247 | arvo_sysfs_show_key_mask, arvo_sysfs_set_key_mask), | ||
248 | __ATTR(actual_profile, 0660, | ||
249 | arvo_sysfs_show_actual_profile, | ||
250 | arvo_sysfs_set_actual_profile), | ||
251 | __ATTR_NULL | ||
252 | }; | 254 | }; |
255 | ATTRIBUTE_GROUPS(arvo); | ||
253 | 256 | ||
254 | static struct bin_attribute arvo_bin_attributes[] = { | 257 | static struct bin_attribute arvo_bin_attributes[] = { |
255 | { | 258 | { |
@@ -430,7 +433,7 @@ static int __init arvo_init(void) | |||
430 | arvo_class = class_create(THIS_MODULE, "arvo"); | 433 | arvo_class = class_create(THIS_MODULE, "arvo"); |
431 | if (IS_ERR(arvo_class)) | 434 | if (IS_ERR(arvo_class)) |
432 | return PTR_ERR(arvo_class); | 435 | return PTR_ERR(arvo_class); |
433 | arvo_class->dev_attrs = arvo_attributes; | 436 | arvo_class->dev_groups = arvo_groups; |
434 | arvo_class->dev_bin_attrs = arvo_bin_attributes; | 437 | arvo_class->dev_bin_attrs = arvo_bin_attributes; |
435 | 438 | ||
436 | retval = hid_register_driver(&arvo_driver); | 439 | retval = hid_register_driver(&arvo_driver); |