steelseries: add fallback button and LED count
Otherwise if there is a device file without them set, will try to create
instances of them and obviously fail with an out-of-memory
error.
@@ -336,7 +336,13 @@ steelseries_probe(struct ratbag_device *device)
device_version = ratbag_device_data_steelseries_get_device_version(device->data);
button_count = ratbag_device_data_steelseries_get_button_count(device->data);
+ if (button_count == -1)
+ button_count = 0;
+
led_count = ratbag_device_data_steelseries_get_led_count(device->data);
+ if (led_count == -1)
+ led_count = 0;
+
dpirange = ratbag_device_data_steelseries_get_dpi_range(device->data);
dpilist = ratbag_device_data_steelseries_get_dpi_list(device->data);
quirk = ratbag_device_data_steelseries_get_quirk(device->data);
