diff options
-rw-r--r-- | drivers/hid/hid-roccat-kovaplus.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c index 1f8336e3f584..112d934132c8 100644 --- a/drivers/hid/hid-roccat-kovaplus.c +++ b/drivers/hid/hid-roccat-kovaplus.c | |||
@@ -323,6 +323,7 @@ static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev, | |||
323 | struct usb_device *usb_dev; | 323 | struct usb_device *usb_dev; |
324 | unsigned long profile; | 324 | unsigned long profile; |
325 | int retval; | 325 | int retval; |
326 | struct kovaplus_roccat_report roccat_report; | ||
326 | 327 | ||
327 | dev = dev->parent->parent; | 328 | dev = dev->parent->parent; |
328 | kovaplus = hid_get_drvdata(dev_get_drvdata(dev)); | 329 | kovaplus = hid_get_drvdata(dev_get_drvdata(dev)); |
@@ -337,10 +338,22 @@ static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev, | |||
337 | 338 | ||
338 | mutex_lock(&kovaplus->kovaplus_lock); | 339 | mutex_lock(&kovaplus->kovaplus_lock); |
339 | retval = kovaplus_set_actual_profile(usb_dev, profile); | 340 | retval = kovaplus_set_actual_profile(usb_dev, profile); |
341 | if (retval) { | ||
342 | mutex_unlock(&kovaplus->kovaplus_lock); | ||
343 | return retval; | ||
344 | } | ||
345 | |||
340 | kovaplus_profile_activated(kovaplus, profile); | 346 | kovaplus_profile_activated(kovaplus, profile); |
347 | |||
348 | roccat_report.type = KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1; | ||
349 | roccat_report.profile = profile + 1; | ||
350 | roccat_report.button = 0; | ||
351 | roccat_report.data1 = profile + 1; | ||
352 | roccat_report.data2 = 0; | ||
353 | roccat_report_event(kovaplus->chrdev_minor, | ||
354 | (uint8_t const *)&roccat_report); | ||
355 | |||
341 | mutex_unlock(&kovaplus->kovaplus_lock); | 356 | mutex_unlock(&kovaplus->kovaplus_lock); |
342 | if (retval) | ||
343 | return retval; | ||
344 | 357 | ||
345 | return size; | 358 | return size; |
346 | } | 359 | } |