hidpp20-drv: fix number of buttons for non-profiles mice

This was nasty. We correctly set the number of buttons but rely later
on the field set in drv_data.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2017-10-23 10:57:04 +02:00
committed by Peter Hutterer
parent e2190964c2
commit 1fab318dd3

View File

@@ -1052,7 +1052,7 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature)
/* we read the profile once to get the correct number of
* supported buttons. */
if (!hidpp20drv_read_special_key_mouse(device))
device->num_buttons = drv_data->num_controls;
drv_data->num_buttons = drv_data->num_controls;
break;
}
case HIDPP_PAGE_BATTERY_LEVEL_STATUS: {
@@ -1077,7 +1077,7 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature)
/* we read the profile once to get the correct number of
* supported buttons. */
if (!hidpp20drv_read_kbd_reprogrammable_key(device))
device->num_buttons = drv_data->num_controls;
drv_data->num_buttons = drv_data->num_controls;
break;
}
case HIDPP_PAGE_ADJUSTABLE_REPORT_RATE: {