diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 00:05:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-20 06:22:34 +0200 |
commit | 46a58c44c173d3cbfa53931fbb7ad069ef59f190 (patch) | |
tree | abccb167ff6c43c04215b7e670513d669afa10b9 /drivers/hid/hid-roccat-pyra.c | |
parent | devfreq: convert devfreq_class to use dev_groups (diff) | |
download | linux-46a58c44c173d3cbfa53931fbb7ad069ef59f190.tar.xz linux-46a58c44c173d3cbfa53931fbb7ad069ef59f190.zip |
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-pyra.c')
-rw-r--r-- | drivers/hid/hid-roccat-pyra.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index d4f1e3bee590..7960d507ad9a 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c @@ -266,6 +266,7 @@ static ssize_t pyra_sysfs_show_actual_cpi(struct device *dev, hid_get_drvdata(dev_get_drvdata(dev->parent->parent)); return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi); } +static DEVICE_ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL); static ssize_t pyra_sysfs_show_actual_profile(struct device *dev, struct device_attribute *attr, char *buf) @@ -282,6 +283,8 @@ static ssize_t pyra_sysfs_show_actual_profile(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile); } +static DEVICE_ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL); +static DEVICE_ATTR(startup_profile, 0440, pyra_sysfs_show_actual_profile, NULL); static ssize_t pyra_sysfs_show_firmware_version(struct device *dev, struct device_attribute *attr, char *buf) @@ -301,16 +304,17 @@ static ssize_t pyra_sysfs_show_firmware_version(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version); } - -static struct device_attribute pyra_attributes[] = { - __ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL), - __ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL), - __ATTR(firmware_version, 0440, - pyra_sysfs_show_firmware_version, NULL), - __ATTR(startup_profile, 0440, - pyra_sysfs_show_actual_profile, NULL), - __ATTR_NULL +static DEVICE_ATTR(firmware_version, 0440, pyra_sysfs_show_firmware_version, + NULL); + +static struct attribute *pyra_attrs[] = { + &dev_attr_actual_cpi.attr, + &dev_attr_actual_profile.attr, + &dev_attr_firmware_version.attr, + &dev_attr_startup_profile.attr, + NULL, }; +ATTRIBUTE_GROUPS(pyra); static struct bin_attribute pyra_bin_attributes[] = { PYRA_BIN_ATTRIBUTE_W(control, CONTROL), @@ -600,7 +604,7 @@ static int __init pyra_init(void) pyra_class = class_create(THIS_MODULE, "pyra"); if (IS_ERR(pyra_class)) return PTR_ERR(pyra_class); - pyra_class->dev_attrs = pyra_attributes; + pyra_class->dev_groups = pyra_groups; pyra_class->dev_bin_attrs = pyra_bin_attributes; retval = hid_register_driver(&pyra_driver); |