diff options
Diffstat (limited to 'drivers/hid/hid-roccat-kone.c')
-rw-r--r-- | drivers/hid/hid-roccat-kone.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index 17f2dc04f883..f77695762cb5 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c | |||
@@ -22,11 +22,6 @@ | |||
22 | * Is it possible to remove and reinstall the urb in raw-event- or any | 22 | * Is it possible to remove and reinstall the urb in raw-event- or any |
23 | * other handler, or to defer this action to be executed somewhere else? | 23 | * other handler, or to defer this action to be executed somewhere else? |
24 | * | 24 | * |
25 | * TODO implement notification mechanism for overlong macro execution | ||
26 | * If user wants to execute an overlong macro only the names of macroset | ||
27 | * and macro are given. Should userland tap hidraw or is there an | ||
28 | * additional streaming mechanism? | ||
29 | * | ||
30 | * TODO is it possible to overwrite group for sysfs attributes via udev? | 25 | * TODO is it possible to overwrite group for sysfs attributes via udev? |
31 | */ | 26 | */ |
32 | 27 | ||
@@ -277,7 +272,7 @@ static ssize_t kone_sysfs_read_settings(struct file *fp, struct kobject *kobj, | |||
277 | count = sizeof(struct kone_settings) - off; | 272 | count = sizeof(struct kone_settings) - off; |
278 | 273 | ||
279 | mutex_lock(&kone->kone_lock); | 274 | mutex_lock(&kone->kone_lock); |
280 | memcpy(buf, &kone->settings + off, count); | 275 | memcpy(buf, ((char const *)&kone->settings) + off, count); |
281 | mutex_unlock(&kone->kone_lock); | 276 | mutex_unlock(&kone->kone_lock); |
282 | 277 | ||
283 | return count; | 278 | return count; |
@@ -337,7 +332,7 @@ static ssize_t kone_sysfs_read_profilex(struct kobject *kobj, | |||
337 | count = sizeof(struct kone_profile) - off; | 332 | count = sizeof(struct kone_profile) - off; |
338 | 333 | ||
339 | mutex_lock(&kone->kone_lock); | 334 | mutex_lock(&kone->kone_lock); |
340 | memcpy(buf, &kone->profiles[number - 1], sizeof(struct kone_profile)); | 335 | memcpy(buf, ((char const *)&kone->profiles[number - 1]) + off, count); |
341 | mutex_unlock(&kone->kone_lock); | 336 | mutex_unlock(&kone->kone_lock); |
342 | 337 | ||
343 | return count; | 338 | return count; |
@@ -623,18 +618,6 @@ static ssize_t kone_sysfs_set_startup_profile(struct device *dev, | |||
623 | } | 618 | } |
624 | 619 | ||
625 | /* | 620 | /* |
626 | * This file is used by userland software to find devices that are handled by | ||
627 | * this driver. This provides a consistent way for actual and older kernels | ||
628 | * where this driver replaced usbhid instead of generic-usb. | ||
629 | * Driver capabilities are determined by version number. | ||
630 | */ | ||
631 | static ssize_t kone_sysfs_show_driver_version(struct device *dev, | ||
632 | struct device_attribute *attr, char *buf) | ||
633 | { | ||
634 | return snprintf(buf, PAGE_SIZE, ROCCAT_KONE_DRIVER_VERSION "\n"); | ||
635 | } | ||
636 | |||
637 | /* | ||
638 | * Read actual dpi settings. | 621 | * Read actual dpi settings. |
639 | * Returns raw value for further processing. Refer to enum kone_polling_rates to | 622 | * Returns raw value for further processing. Refer to enum kone_polling_rates to |
640 | * get real value. | 623 | * get real value. |
@@ -671,9 +654,6 @@ static DEVICE_ATTR(startup_profile, 0660, | |||
671 | kone_sysfs_show_startup_profile, | 654 | kone_sysfs_show_startup_profile, |
672 | kone_sysfs_set_startup_profile); | 655 | kone_sysfs_set_startup_profile); |
673 | 656 | ||
674 | static DEVICE_ATTR(kone_driver_version, 0440, | ||
675 | kone_sysfs_show_driver_version, NULL); | ||
676 | |||
677 | static struct attribute *kone_attributes[] = { | 657 | static struct attribute *kone_attributes[] = { |
678 | &dev_attr_actual_dpi.attr, | 658 | &dev_attr_actual_dpi.attr, |
679 | &dev_attr_actual_profile.attr, | 659 | &dev_attr_actual_profile.attr, |
@@ -681,7 +661,6 @@ static struct attribute *kone_attributes[] = { | |||
681 | &dev_attr_firmware_version.attr, | 661 | &dev_attr_firmware_version.attr, |
682 | &dev_attr_tcu.attr, | 662 | &dev_attr_tcu.attr, |
683 | &dev_attr_startup_profile.attr, | 663 | &dev_attr_startup_profile.attr, |
684 | &dev_attr_kone_driver_version.attr, | ||
685 | NULL | 664 | NULL |
686 | }; | 665 | }; |
687 | 666 | ||