From 03d2d71f823a4626fe6c9052cb19036d7d5f3929 Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Fri, 28 Jan 2022 15:55:46 +0300 Subject: [PATCH] sinowealth: don't enable LED support if LED type is not defined --- src/driver-sinowealth.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver-sinowealth.c b/src/driver-sinowealth.c index 3a8b29f8..4ad4e6c3 100644 --- a/src/driver-sinowealth.c +++ b/src/driver-sinowealth.c @@ -614,15 +614,6 @@ sinowealth_init_profile(struct ratbag_device *device) if (rc) return rc; - /* LED count. */ - drv_data->led_count = 0; - if (config->rgb_effect != RGB_NOT_SUPPORTED) { - drv_data->led_count += 1; - } - /* We may want to account for the DPI LEDs in the future. - * We don't support them yet, so it's not a priority now. - */ - if (strncmp(fw_version, "V102", 4) == 0) { log_info(device->ratbag, "Found a Glorious Model O (old firmware) or a Glorious Model D\n"); @@ -662,6 +653,15 @@ sinowealth_init_profile(struct ratbag_device *device) log_info(device->ratbag, "Found an unknown SinoWealth mouse\n"); } + /* LED count. */ + drv_data->led_count = 0; + if (config->rgb_effect != RGB_NOT_SUPPORTED && drv_data->led_type != LED_NONE) { + drv_data->led_count += 1; + } + /* We may want to account for the DPI LEDs in the future. + * We don't support them yet, so it's not a priority now. + */ + /* number of DPIs = all DPIs from min to max (inclusive) and "0 DPI" as a special value * to signal a disabled DPI step. */