aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-arvo.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-20 00:40:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-20 00:46:53 -0400
commite0a00d86000729caf3a3e60732723183ebb6b144 (patch)
tree70a9430bb704bda296a632a9da2440bc9b1d72e9 /drivers/hid/hid-roccat-arvo.c
parentd9e1241e469bbd4b483e0996e404fdce46735b48 (diff)
hid: roccat-arvo: convert class code to use bin_attrs in groups
Now that attribute groups support binary attributes, use them instead of the dev_bin_attrs field in struct class, as that is going away soon. 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.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c
index 98bb89e0d91b..eed7f52084c5 100644
--- a/drivers/hid/hid-roccat-arvo.c
+++ b/drivers/hid/hid-roccat-arvo.c
@@ -237,6 +237,8 @@ static ssize_t arvo_sysfs_write_button(struct file *fp,
237 return arvo_sysfs_write(fp, kobj, buf, off, count, 237 return arvo_sysfs_write(fp, kobj, buf, off, count,
238 sizeof(struct arvo_button), ARVO_COMMAND_BUTTON); 238 sizeof(struct arvo_button), ARVO_COMMAND_BUTTON);
239} 239}
240static BIN_ATTR(button, 0220, NULL, arvo_sysfs_write_button,
241 sizeof(struct arvo_button));
240 242
241static ssize_t arvo_sysfs_read_info(struct file *fp, 243static ssize_t arvo_sysfs_read_info(struct file *fp,
242 struct kobject *kobj, struct bin_attribute *attr, char *buf, 244 struct kobject *kobj, struct bin_attribute *attr, char *buf,
@@ -245,6 +247,8 @@ static ssize_t arvo_sysfs_read_info(struct file *fp,
245 return arvo_sysfs_read(fp, kobj, buf, off, count, 247 return arvo_sysfs_read(fp, kobj, buf, off, count,
246 sizeof(struct arvo_info), ARVO_COMMAND_INFO); 248 sizeof(struct arvo_info), ARVO_COMMAND_INFO);
247} 249}
250static BIN_ATTR(info, 0440, arvo_sysfs_read_info, NULL,
251 sizeof(struct arvo_info));
248 252
249static struct attribute *arvo_attrs[] = { 253static struct attribute *arvo_attrs[] = {
250 &dev_attr_mode_key.attr, 254 &dev_attr_mode_key.attr,
@@ -252,20 +256,21 @@ static struct attribute *arvo_attrs[] = {
252 &dev_attr_actual_profile.attr, 256 &dev_attr_actual_profile.attr,
253 NULL, 257 NULL,
254}; 258};
255ATTRIBUTE_GROUPS(arvo); 259
256 260static struct bin_attribute *arvo_bin_attributes[] = {
257static struct bin_attribute arvo_bin_attributes[] = { 261 &bin_attr_button,
258 { 262 &bin_attr_info,
259 .attr = { .name = "button", .mode = 0220 }, 263 NULL,
260 .size = sizeof(struct arvo_button), 264};
261 .write = arvo_sysfs_write_button 265
262 }, 266static const struct attribute_group arvo_group = {
263 { 267 .attrs = arvo_attrs,
264 .attr = { .name = "info", .mode = 0440 }, 268 .bin_attrs = arvo_bin_attributes,
265 .size = sizeof(struct arvo_info), 269};
266 .read = arvo_sysfs_read_info 270
267 }, 271static const struct attribute_group *arvo_groups[] = {
268 __ATTR_NULL 272 &arvo_group,
273 NULL,
269}; 274};
270 275
271static int arvo_init_arvo_device_struct(struct usb_device *usb_dev, 276static int arvo_init_arvo_device_struct(struct usb_device *usb_dev,
@@ -434,7 +439,6 @@ static int __init arvo_init(void)
434 if (IS_ERR(arvo_class)) 439 if (IS_ERR(arvo_class))
435 return PTR_ERR(arvo_class); 440 return PTR_ERR(arvo_class);
436 arvo_class->dev_groups = arvo_groups; 441 arvo_class->dev_groups = arvo_groups;
437 arvo_class->dev_bin_attrs = arvo_bin_attributes;
438 442
439 retval = hid_register_driver(&arvo_driver); 443 retval = hid_register_driver(&arvo_driver);
440 if (retval) 444 if (retval)